hyrax 2.1.0.beta1 → 2.1.0.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -49
- data/.rubocop_fixme.yml +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +3 -3
- data/README.md +4 -2
- data/app/actors/hyrax/actors/file_set_actor.rb +0 -1
- data/app/actors/hyrax/actors/interpret_visibility_actor.rb +1 -3
- data/app/actors/hyrax/actors/model_actor.rb +4 -0
- data/app/assets/javascripts/hyrax.js +1 -1
- data/app/assets/javascripts/hyrax/app.js.erb +1 -1
- data/app/assets/javascripts/hyrax/authority_select.es6 +15 -7
- data/app/assets/javascripts/hyrax/collections.js +188 -9
- data/app/assets/javascripts/hyrax/content_blocks.js +13 -1
- data/app/assets/javascripts/hyrax/editor.es6 +2 -1
- data/app/assets/javascripts/hyrax/proxy_rights.js +2 -2
- data/app/assets/javascripts/hyrax/turbolinks_events.js +5 -0
- data/app/assets/stylesheets/hyrax/_accessibility.scss +21 -0
- data/app/assets/stylesheets/hyrax/_catalog.scss +21 -16
- data/app/assets/stylesheets/hyrax/_collections.scss +48 -7
- data/app/assets/stylesheets/hyrax/_modal.scss +4 -0
- data/app/assets/stylesheets/hyrax/_settings.scss +1 -1
- data/app/assets/stylesheets/hyrax/dashboard.scss +0 -1
- data/app/controllers/concerns/hyrax/breadcrumbs.rb +3 -1
- data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +17 -1
- data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +10 -0
- data/app/controllers/concerns/hyrax/local_file_downloads_controller_behavior.rb +86 -0
- data/app/controllers/concerns/hyrax/works_controller_behavior.rb +14 -11
- data/app/controllers/hyrax/admin/collection_types_controller.rb +11 -1
- data/app/controllers/hyrax/api/items_controller.rb +2 -6
- data/app/controllers/hyrax/batch_edits_controller.rb +6 -0
- data/app/controllers/hyrax/batch_uploads_controller.rb +1 -1
- data/app/controllers/hyrax/dashboard/collections_controller.rb +4 -7
- data/app/controllers/hyrax/dashboard/profiles_controller.rb +2 -0
- data/app/controllers/hyrax/dashboard_controller.rb +2 -2
- data/app/controllers/hyrax/depositors_controller.rb +19 -0
- data/app/controllers/hyrax/downloads_controller.rb +3 -4
- data/app/controllers/hyrax/embargoes_controller.rb +2 -0
- data/app/controllers/hyrax/file_sets_controller.rb +12 -0
- data/app/controllers/hyrax/leases_controller.rb +2 -0
- data/app/controllers/hyrax/my/works_controller.rb +9 -0
- data/app/controllers/hyrax/my_controller.rb +0 -1
- data/app/controllers/hyrax/transfers_controller.rb +1 -3
- data/app/controllers/hyrax/users_controller.rb +1 -3
- data/app/forms/hyrax/forms/admin/collection_type_form.rb +1 -1
- data/app/forms/hyrax/forms/permission_template_form.rb +1 -4
- data/app/forms/hyrax/forms/work_form.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/common_behavior.rb +1 -3
- data/app/helpers/hyrax/citations_behaviors/formatters/chicago_formatter.rb +1 -5
- data/app/helpers/hyrax/collections_helper.rb +7 -4
- data/app/helpers/hyrax/file_set_helper.rb +0 -1
- data/app/helpers/hyrax/hyrax_helper_behavior.rb +0 -1
- data/app/helpers/hyrax/trophy_helper.rb +0 -1
- data/app/indexers/hyrax/admin_set_indexer.rb +2 -0
- data/app/inputs/multi_value_select_input.rb +1 -3
- data/app/jobs/attach_files_to_work_job.rb +5 -1
- data/app/jobs/import_url_job.rb +9 -8
- data/app/models/admin_set.rb +1 -5
- data/app/models/concerns/hyrax/ability.rb +3 -4
- data/app/models/concerns/hyrax/collection_behavior.rb +0 -4
- data/app/models/concerns/hyrax/collection_nesting.rb +12 -0
- data/app/models/concerns/hyrax/suppressible.rb +1 -5
- data/app/models/featured_work_list.rb +1 -3
- data/app/models/hyrax/collection_type.rb +3 -2
- data/app/models/hyrax/permission_template_access.rb +6 -4
- data/app/models/proxy_deposit_request.rb +1 -1
- data/app/presenters/hyrax/collection_presenter.rb +0 -24
- data/app/presenters/hyrax/displays_image.rb +1 -1
- data/app/presenters/hyrax/file_set_presenter.rb +1 -1
- data/app/presenters/hyrax/menu_presenter.rb +1 -1
- data/app/presenters/hyrax/work_show_presenter.rb +15 -10
- data/app/search_builders/hyrax/abstract_type_relation.rb +2 -1
- data/app/search_builders/hyrax/collection_member_search_builder.rb +1 -1
- data/app/search_builders/hyrax/dashboard/collections_search_builder.rb +3 -1
- data/app/search_builders/hyrax/parent_collection_search_builder.rb +2 -2
- data/app/services/hyrax/admin_set_create_service.rb +1 -3
- data/app/services/hyrax/analytics.rb +1 -3
- data/app/services/hyrax/collection_member_service.rb +6 -5
- data/app/services/hyrax/collection_types/create_service.rb +37 -10
- data/app/services/hyrax/collections/permissions_create_service.rb +1 -3
- data/app/services/hyrax/collections/permissions_service.rb +6 -4
- data/app/views/catalog/_index_header_list_collection.html.erb +1 -1
- data/app/views/catalog/_index_header_list_default.html.erb +1 -1
- data/app/views/catalog/_index_list_default.html.erb +6 -10
- data/app/views/catalog/_search_form.html.erb +10 -11
- data/app/views/catalog/_thumbnail_list_collection.html.erb +1 -1
- data/app/views/catalog/_thumbnail_list_default.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participant_table.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_participants.html.erb +1 -1
- data/app/views/hyrax/admin/admin_sets/_form_visibility.html.erb +3 -3
- data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/admin/admin_sets/index.html.erb +1 -1
- data/app/views/hyrax/admin/appearances/show.html.erb +4 -4
- data/app/views/hyrax/admin/collection_types/_form_settings.html.erb +3 -2
- data/app/views/hyrax/admin/collection_types/index.html.erb +2 -2
- data/app/views/hyrax/admin/features/index.html.erb +2 -4
- data/app/views/hyrax/admin/stats/_date_form.html.erb +3 -3
- data/app/views/hyrax/admin/stats/_top_data.html.erb +1 -1
- data/app/views/hyrax/admin/stats/show.html.erb +1 -1
- data/app/views/hyrax/admin/workflows/index.html.erb +0 -1
- data/app/views/hyrax/base/_file_manager_actions.html.erb +2 -2
- data/app/views/hyrax/base/_file_manager_member.html.erb +1 -1
- data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -2
- data/app/views/hyrax/base/_form_files.html.erb +3 -3
- data/app/views/hyrax/base/_form_member_of_collections.html.erb +1 -2
- data/app/views/hyrax/base/_form_progress.html.erb +3 -3
- data/app/views/hyrax/base/_form_relationships.html.erb +2 -3
- data/app/views/hyrax/base/_form_representative.html.erb +0 -1
- data/app/views/hyrax/base/_form_share.html.erb +1 -3
- data/app/views/hyrax/base/_form_thumbnail.html.erb +0 -1
- data/app/views/hyrax/base/_form_visibility_component.html.erb +6 -6
- data/app/views/hyrax/base/_relationships_parent_rows.html.erb +3 -1
- data/app/views/hyrax/base/_representative_media.html.erb +1 -1
- data/app/views/hyrax/base/_share_with.html.erb +3 -3
- data/app/views/hyrax/base/_show_actions.html.erb +14 -1
- data/app/views/hyrax/base/_social_media.html.erb +5 -5
- data/app/views/hyrax/base/_work_title.erb +3 -1
- data/app/views/hyrax/base/_workflow_actions.html.erb +1 -1
- data/app/views/hyrax/base/inspect_work.html.erb +1 -1
- data/app/views/hyrax/base/show.html.erb +2 -2
- data/app/views/hyrax/batch_edits/_check_all.html.erb +2 -2
- data/app/views/hyrax/batch_edits/edit.html.erb +47 -44
- data/app/views/hyrax/batch_select/_add_button.html.erb +2 -2
- data/app/views/hyrax/citations/work.html.erb +3 -3
- data/app/views/hyrax/collections/_collection.html.erb +1 -1
- data/app/views/hyrax/collections/_default_group.html.erb +1 -1
- data/app/views/hyrax/collections/_list_collections.html.erb +2 -2
- data/app/views/hyrax/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/collections/_show_descriptions.html.erb +6 -6
- data/app/views/hyrax/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/collections/_show_parent_collections.html.erb +11 -38
- data/app/views/hyrax/collections/_sort_and_per_page.html.erb +13 -13
- data/app/views/hyrax/collections/_subcollection_list.html.erb +1 -1
- data/app/views/hyrax/collections/_view_type_group.html.erb +1 -1
- data/app/views/hyrax/collections/show.html.erb +122 -122
- data/app/views/hyrax/content_blocks/_form.html.erb +13 -12
- data/app/views/hyrax/content_blocks/_modal_content_block.html.erb +15 -0
- data/app/views/hyrax/dashboard/_index_partials/_proxy_rights.html.erb +25 -19
- data/app/views/hyrax/dashboard/_sidebar.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_button_for_remove_selected_from_collection.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_collection_title.html.erb +16 -16
- data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -1
- data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +11 -11
- data/app/views/hyrax/dashboard/collections/_form_default_group_delt.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_form_discovery.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_form_for_select_collection.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_form_share.html.erb +51 -44
- data/app/views/hyrax/dashboard/collections/_form_share_table.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +4 -4
- data/app/views/hyrax/dashboard/collections/_list_works.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_modal_remove_from_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_modal_remove_sub_collection.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_actions.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_show_add_items_actions.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_document_list_row.html.erb +2 -2
- data/app/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb +10 -5
- data/app/views/hyrax/dashboard/collections/_show_parent_collections.html.erb +11 -34
- data/app/views/hyrax/dashboard/collections/_sort_and_per_page.html.erb +1 -1
- data/app/views/hyrax/dashboard/collections/_subcollection_list.html.erb +23 -17
- data/app/views/hyrax/dashboard/collections/show.html.erb +6 -6
- data/app/views/hyrax/dashboard/profiles/_edit_primary.html.erb +0 -4
- data/app/views/hyrax/dashboard/profiles/_trophy_edit.html.erb +16 -14
- data/app/views/hyrax/dashboard/profiles/show.html.erb +6 -0
- data/app/views/hyrax/dashboard/show_admin.html.erb +19 -3
- data/app/views/hyrax/dashboard/sidebar/_activity.html.erb +6 -0
- data/app/views/hyrax/dashboard/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/depositors/index.html.erb +13 -0
- data/app/views/hyrax/embargoes/_list_expired_active_embargoes.html.erb +1 -1
- data/app/views/hyrax/embargoes/edit.html.erb +47 -35
- data/app/views/hyrax/embargoes/index.html.erb +6 -7
- data/app/views/hyrax/file_sets/_actions.html.erb +6 -2
- data/app/views/hyrax/file_sets/_extra_fields_modal.html.erb +3 -3
- data/app/views/hyrax/file_sets/_groups_description.html.erb +0 -1
- data/app/views/hyrax/file_sets/_permission_form.html.erb +3 -3
- data/app/views/hyrax/file_sets/edit.html.erb +24 -20
- data/app/views/hyrax/file_sets/media_display/_audio.html.erb +23 -6
- data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
- data/app/views/hyrax/file_sets/media_display/_video.html.erb +23 -6
- data/app/views/hyrax/leases/_list_expired_active_leases.html.erb +1 -1
- data/app/views/hyrax/leases/edit.html.erb +47 -35
- data/app/views/hyrax/leases/index.html.erb +6 -6
- data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -1
- data/app/views/hyrax/my/_facet_limit.html.erb +1 -2
- data/app/views/hyrax/my/_facet_pagination.html.erb +6 -6
- data/app/views/hyrax/my/_facet_pivot.html.erb +1 -1
- data/app/views/hyrax/my/_results_pagination.html.erb +1 -1
- data/app/views/hyrax/my/collections/_facets.html.erb +1 -1
- data/app/views/hyrax/my/collections/_list_collections.html.erb +5 -5
- data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -2
- data/app/views/hyrax/my/collections/_modal_add_to_collection.html.erb +3 -1
- data/app/views/hyrax/my/collections/_modal_add_to_collection_permission_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_collection_types_to_create.html.erb +2 -2
- data/app/views/hyrax/my/collections/_modal_delete_collection.html.erb +1 -2
- data/app/views/hyrax/my/collections/_modal_delete_deny.html.erb +1 -1
- data/app/views/hyrax/my/collections/_modal_delete_selected_collections.html.erb +2 -2
- data/app/views/hyrax/my/collections/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/collections/index.html.erb +7 -3
- data/app/views/hyrax/my/facet.html.erb +1 -1
- data/app/views/hyrax/my/index.html.erb +6 -2
- data/app/views/hyrax/my/works/_facets.html.erb +1 -1
- data/app/views/hyrax/my/works/_list_works.html.erb +1 -1
- data/app/views/hyrax/my/works/_tabs.html.erb +2 -2
- data/app/views/hyrax/my/works/index.html.erb +6 -2
- data/app/views/hyrax/notifications/_notifications.html.erb +1 -1
- data/app/views/hyrax/pages/_form.html.erb +12 -12
- data/app/views/hyrax/pages/show.html.erb +1 -1
- data/app/views/hyrax/single_use_links_viewer/show.html.erb +1 -1
- data/app/views/hyrax/stats/file.html.erb +6 -2
- data/app/views/hyrax/stats/work.html.erb +6 -2
- data/app/views/hyrax/transfers/_received.html.erb +6 -6
- data/app/views/hyrax/transfers/_sent.html.erb +2 -2
- data/app/views/hyrax/transfers/new.html.erb +0 -1
- data/app/views/hyrax/users/_activity_log.html.erb +2 -2
- data/app/views/hyrax/users/_profile_tabs.html.erb +1 -1
- data/app/views/hyrax/users/_search_form.html.erb +1 -1
- data/app/views/hyrax/users/_user.html.erb +0 -1
- data/app/views/hyrax/users/index.html.erb +1 -1
- data/app/views/kaminari/blacklight_compact/_paginator.html.erb +1 -2
- data/app/views/layouts/_head_tag_content.html.erb +2 -2
- data/app/views/layouts/error.html.erb +1 -1
- data/app/views/layouts/hyrax.html.erb +6 -3
- data/app/views/layouts/hyrax/dashboard.html.erb +6 -3
- data/app/views/records/show_fields/_based_near.html.erb +0 -1
- data/app/views/records/show_fields/_contributor.html.erb +0 -1
- data/app/views/records/show_fields/_date_created.html.erb +0 -1
- data/app/views/records/show_fields/_description.html.erb +1 -1
- data/app/views/records/show_fields/_identifier.html.erb +0 -1
- data/app/views/records/show_fields/_language.html.erb +0 -1
- data/app/views/records/show_fields/_publisher.html.erb +0 -1
- data/app/views/records/show_fields/_related_url.html.erb +0 -1
- data/app/views/records/show_fields/_resource_type.html.erb +0 -1
- data/app/views/records/show_fields/_subject.html.erb +0 -1
- data/app/views/shared/_citations.html.erb +17 -17
- data/app/views/shared/_select_work_type_modal.html.erb +2 -2
- data/config/locales/hyrax.de.yml +198 -189
- data/config/locales/hyrax.en.yml +21 -14
- data/config/locales/hyrax.es.yml +9 -0
- data/config/locales/hyrax.fr.yml +9 -0
- data/config/locales/hyrax.it.yml +9 -0
- data/config/locales/hyrax.pt-BR.yml +9 -0
- data/config/locales/hyrax.zh.yml +9 -0
- data/config/routes.rb +1 -0
- data/hyrax.gemspec +7 -18
- data/lib/generators/hyrax/models_generator.rb +0 -1
- data/lib/generators/hyrax/templates/db/migrate/20180302200051_add_branding_to_collection_type.rb.erb +5 -0
- data/lib/generators/hyrax/work/templates/feature_spec.rb.erb +1 -1
- data/lib/hyrax/configuration.rb +2 -4
- data/lib/hyrax/engine.rb +22 -4
- data/lib/hyrax/version.rb +1 -1
- data/spec/actors/hyrax/actors/lease_actor_spec.rb +16 -0
- data/spec/controllers/hyrax/admin/appearances_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/collection_types_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/admin/features_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflow_roles_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/admin/workflows_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/batch_edits_controller_spec.rb +14 -1
- data/spec/controllers/hyrax/batch_uploads_controller_spec.rb +2 -2
- data/spec/controllers/hyrax/citations_controller_spec.rb +4 -2
- data/spec/controllers/hyrax/collections_controller_spec.rb +32 -4
- data/spec/controllers/hyrax/content_blocks_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/dashboard/collections_controller_spec.rb +11 -6
- data/spec/controllers/hyrax/depositors_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/downloads_controller_spec.rb +42 -0
- data/spec/controllers/hyrax/embargoes_controller_spec.rb +40 -1
- data/spec/controllers/hyrax/file_sets_controller_spec.rb +10 -2
- data/spec/controllers/hyrax/generic_works_controller_spec.rb +38 -6
- data/spec/controllers/hyrax/leases_controller_spec.rb +11 -0
- data/spec/controllers/hyrax/my/collections_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/my/works_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/pages_controller_spec.rb +1 -1
- data/spec/controllers/hyrax/stats_controller_spec.rb +2 -0
- data/spec/controllers/hyrax/transfers_controller_spec.rb +1 -1
- data/spec/factories/collection_types.rb +10 -1
- data/spec/factories/collections.rb +5 -3
- data/spec/factories/collections_factory.rb +3 -3
- data/spec/factories/file_sets.rb +2 -6
- data/spec/factories/generic_works.rb +68 -4
- data/spec/factory_tests/collections_factory_spec.rb +2 -1
- data/spec/features/batch_create_spec.rb +60 -0
- data/spec/features/batch_edit_spec.rb +1 -0
- data/spec/features/browse_dashboard_works_spec.rb +1 -0
- data/spec/features/collection_multi_membership_spec.rb +9 -6
- data/spec/features/collection_spec.rb +1 -1
- data/spec/features/collection_type_spec.rb +49 -1
- data/spec/features/create_work_admin_spec.rb +2 -2
- data/spec/features/create_work_spec.rb +1 -0
- data/spec/features/dashboard/all_works.rb +10 -2
- data/spec/features/dashboard/collection_spec.rb +38 -17
- data/spec/features/dashboard/display_admin_dashboard_spec.rb +29 -0
- data/spec/features/dashboard/display_dashboard_spec.rb +1 -1
- data/spec/features/edit_content_block_admin_spec.rb +45 -0
- data/spec/features/edit_work_spec.rb +40 -2
- data/spec/features/ownership_transfer_spec.rb +1 -0
- data/spec/features/proxy_spec.rb +2 -2
- data/spec/features/search_spec.rb +2 -5
- data/spec/features/work_show_spec.rb +14 -4
- data/spec/forms/hyrax/forms/admin/collection_type_form_spec.rb +1 -0
- data/spec/forms/hyrax/forms/collection_form_spec.rb +1 -1
- data/spec/helpers/hyrax/ability_helper_spec.rb +2 -2
- data/spec/helpers/hyrax/collections_helper_spec.rb +12 -4
- data/spec/javascripts/authority_select_spec.js +1 -1
- data/spec/javascripts/settings_spec.js +1 -0
- data/spec/jobs/attach_files_to_work_job_spec.rb +13 -0
- data/spec/jobs/import_url_job_spec.rb +14 -0
- data/spec/models/collection_spec.rb +1 -0
- data/spec/models/concerns/hyrax/collection_nesting_spec.rb +16 -0
- data/spec/models/hyrax/collection_type_spec.rb +1 -0
- data/spec/presenters/hyrax/collection_presenter_spec.rb +1 -100
- data/spec/presenters/hyrax/file_set_presenter_spec.rb +17 -2
- data/spec/presenters/hyrax/menu_presenter_spec.rb +6 -0
- data/spec/presenters/hyrax/work_show_presenter_spec.rb +15 -3
- data/spec/search_builders/hyrax/abstract_type_relation_spec.rb +18 -0
- data/spec/search_builders/hyrax/dashboard/collections_search_builder_spec.rb +30 -19
- data/spec/search_builders/hyrax/parent_collection_search_builder_spec.rb +15 -0
- data/spec/services/hyrax/collection_member_service_spec.rb +10 -19
- data/spec/services/hyrax/collection_types/create_service_spec.rb +35 -2
- data/spec/services/hyrax/collections/collection_member_service_spec.rb +1 -1
- data/spec/services/hyrax/qa_select_service_spec.rb +0 -1
- data/spec/support/selectors.rb +15 -0
- data/spec/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb_spec.rb +2 -0
- data/spec/views/hyrax/admin/collection_types/_form_settings.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/admin/stats/show.html.erb_spec.rb +9 -0
- data/spec/views/hyrax/base/_attributes.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/base/_relationships.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/base/_show_actions.html.erb_spec.rb +10 -0
- data/spec/views/hyrax/base/show.html.erb_spec.rb +8 -0
- data/spec/views/hyrax/collections/_show_parent_collections.html.erb_spec.rb +3 -53
- data/spec/views/hyrax/dashboard/_sidebar.html.erb_spec.rb +22 -0
- data/spec/views/hyrax/dashboard/collections/_form_share.erb_spec.rb +2 -1
- data/spec/views/hyrax/dashboard/collections/_show_actions.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/dashboard/collections/_show_parent_collection_row.html.erb_spec.rb +26 -8
- data/spec/views/hyrax/dashboard/collections/_show_parent_collections.html.erb_spec.rb +7 -43
- data/spec/views/hyrax/dashboard/collections/_subcollection_list.html.erb_spec.rb +13 -1
- data/spec/views/hyrax/dashboard/collections/show.html.erb_spec.rb +1 -0
- data/spec/views/hyrax/dashboard/profiles/_trophy_edit.html.erb_spec.rb +36 -0
- data/spec/views/hyrax/dashboard/profiles/edit.html.erb_spec.rb +0 -38
- data/spec/views/hyrax/dashboard/profiles/show.html.erb_spec.rb +37 -0
- data/spec/views/hyrax/depositors/index.html.erb_spec.rb +13 -0
- data/spec/views/hyrax/file_sets/_actions.html.erb_spec.rb +15 -0
- data/spec/views/hyrax/file_sets/media_display/_audio.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/file_sets/media_display/_default.html.erb_spec.rb +1 -1
- data/spec/views/hyrax/file_sets/media_display/_video.html.erb_spec.rb +29 -0
- data/spec/views/hyrax/my/collections/_list_collections.html.erb_spec.rb +6 -2
- data/tasks/hyrax_dev.rake +1 -3
- data/template.rb +1 -1
- metadata +49 -41
- data/app/assets/javascripts/hyrax/collections_forms.js +0 -108
data/hyrax.gemspec
CHANGED
@@ -49,7 +49,7 @@ SUMMARY
|
|
49
49
|
spec.add_dependency 'hydra-editor', '~> 3.3'
|
50
50
|
spec.add_dependency 'hydra-head', '>= 10.5.0'
|
51
51
|
spec.add_dependency 'hydra-works', '~> 0.16'
|
52
|
-
spec.add_dependency 'iiif_manifest', '
|
52
|
+
spec.add_dependency 'iiif_manifest', '>= 0.3', '< 0.5'
|
53
53
|
spec.add_dependency 'jquery-datatables-rails', '~> 3.4'
|
54
54
|
spec.add_dependency 'jquery-ui-rails', '~> 6.0'
|
55
55
|
spec.add_dependency 'json-schema' # for Arkivo
|
@@ -83,7 +83,7 @@ SUMMARY
|
|
83
83
|
spec.add_development_dependency 'database_cleaner', '~> 1.3'
|
84
84
|
spec.add_development_dependency 'engine_cart', '~> 1.2'
|
85
85
|
spec.add_development_dependency "equivalent-xml", '~> 0.5'
|
86
|
-
spec.add_development_dependency "
|
86
|
+
spec.add_development_dependency "factory_bot", '~> 4.4'
|
87
87
|
spec.add_development_dependency 'fcrepo_wrapper', '~> 0.5', '>= 0.5.1'
|
88
88
|
spec.add_development_dependency "jasmine", '~> 2.3', '< 2.99'
|
89
89
|
spec.add_development_dependency "jasmine-core", '~> 2.3', '< 2.99'
|
@@ -93,21 +93,11 @@ SUMMARY
|
|
93
93
|
spec.add_development_dependency 'rspec-rails', '~> 3.1'
|
94
94
|
spec.add_development_dependency "selenium-webdriver"
|
95
95
|
spec.add_development_dependency 'solr_wrapper', '~> 1.1'
|
96
|
-
# Pin rubocop and rubocop-rspec tightly. Minor-level version bumps
|
97
|
-
# in these gems cause Rubocop violations, and those violations cause
|
98
|
-
# continuous integration builds to fail, and those failures prevent
|
99
|
-
# us from merging pull requests. As a community, we have decided
|
100
|
-
# that it is not reasonable to manage style violations to be dealt
|
101
|
-
# with in a pull request *unless* said pull request's intent is to
|
102
|
-
# bring the codebase in further alignment with community style
|
103
|
-
# conventions. This allows us to take a managed approach to code
|
104
|
-
# style -- we choose to update style when we wish, not when a
|
105
|
-
# minor-level version bump in a dependency comes out.
|
106
96
|
spec.add_development_dependency 'i18n-debug' if ENV['I18N_DEBUG']
|
107
97
|
spec.add_development_dependency 'i18n_yaml_sorter' unless ENV['TRAVIS']
|
108
98
|
spec.add_development_dependency 'rails-controller-testing', '~> 1'
|
109
|
-
|
110
|
-
spec.add_development_dependency '
|
99
|
+
# the hyrax style guide is based on `bixby`. see `.rubocop.yml`
|
100
|
+
spec.add_development_dependency 'bixby', '~> 1.0.0'
|
111
101
|
spec.add_development_dependency 'shoulda-callback-matchers', '~> 1.1.1'
|
112
102
|
spec.add_development_dependency 'shoulda-matchers', '~> 3.1'
|
113
103
|
spec.add_development_dependency 'webmock'
|
@@ -115,8 +105,7 @@ SUMMARY
|
|
115
105
|
########################################################
|
116
106
|
# Temporarily pinned dependencies. INCLUDE EXPLANATIONS.
|
117
107
|
#
|
118
|
-
# simple_form 3.5.1 broke
|
119
|
-
|
120
|
-
|
121
|
-
spec.add_development_dependency 'parser', '< 2.5'
|
108
|
+
# simple_form 3.5.1 broke hydra-editor for certain model types;
|
109
|
+
# see: https://github.com/plataformatec/simple_form/issues/1549
|
110
|
+
spec.add_dependency 'simple_form', '~> 3.2', '<= 3.5.0'
|
122
111
|
end
|
@@ -13,7 +13,7 @@ RSpec.feature 'Create a <%= class_name %>', js: false do
|
|
13
13
|
User.new(user_attributes) { |u| u.save(validate: false) }
|
14
14
|
end
|
15
15
|
let(:admin_set_id) { AdminSet.find_or_create_default_admin_set_id }
|
16
|
-
let(:permission_template) { Hyrax::PermissionTemplate.find_or_create_by!(
|
16
|
+
let(:permission_template) { Hyrax::PermissionTemplate.find_or_create_by!(source_id: admin_set_id) }
|
17
17
|
let(:workflow) { Sipity::Workflow.create!(active: true, name: 'test-workflow', permission_template: permission_template) }
|
18
18
|
|
19
19
|
before do
|
data/lib/hyrax/configuration.rb
CHANGED
@@ -118,7 +118,7 @@ module Hyrax
|
|
118
118
|
|
119
119
|
attr_writer :noid_minter_class
|
120
120
|
def noid_minter_class
|
121
|
-
@noid_minter_class ||= Noid::Rails::Minter::Db
|
121
|
+
@noid_minter_class ||= ::Noid::Rails::Minter::Db
|
122
122
|
end
|
123
123
|
|
124
124
|
attr_writer :minter_statefile
|
@@ -206,9 +206,7 @@ module Hyrax
|
|
206
206
|
# @param [Array<Symbol>,Symbol] curation_concern_types
|
207
207
|
def register_curation_concern(*curation_concern_types)
|
208
208
|
Array.wrap(curation_concern_types).flatten.compact.each do |cc_type|
|
209
|
-
unless @registered_concerns.include?(cc_type)
|
210
|
-
@registered_concerns << cc_type
|
211
|
-
end
|
209
|
+
@registered_concerns << cc_type unless @registered_concerns.include?(cc_type)
|
212
210
|
end
|
213
211
|
end
|
214
212
|
|
data/lib/hyrax/engine.rb
CHANGED
@@ -32,10 +32,28 @@ module Hyrax
|
|
32
32
|
end
|
33
33
|
|
34
34
|
config.after_initialize do
|
35
|
-
|
35
|
+
# Attempt to establish a connection before trying to do anything with it. This has to rescue
|
36
|
+
# StandardError instead of, e.g., ActiveRecord::ConnectionNotEstablished or ActiveRecord::NoDatabaseError
|
37
|
+
# because we can't be absolutely sure what the specific database adapter will raise. pg, for example,
|
38
|
+
# raises PG::ConnectionBad. There's no good common ancestor to assume. That's why this test
|
39
|
+
# is in its own tiny chunk of code – so we know that whatever the StandardError is, it's coming
|
40
|
+
# from the attempt to connect.
|
41
|
+
can_connect = begin
|
42
|
+
ActiveRecord::Base.connection
|
43
|
+
true
|
44
|
+
rescue StandardError
|
45
|
+
false
|
46
|
+
end
|
47
|
+
|
48
|
+
can_persist = can_connect && begin
|
36
49
|
Hyrax.config.persist_registered_roles!
|
37
50
|
Rails.logger.info("Hyrax::Engine.after_initialize - persisting registered roles!")
|
51
|
+
true
|
38
52
|
rescue ActiveRecord::StatementInvalid
|
53
|
+
false
|
54
|
+
end
|
55
|
+
|
56
|
+
unless can_persist
|
39
57
|
message = "Hyrax::Engine.after_initialize - unable to persist registered roles.\n"
|
40
58
|
message += "It is expected during the application installation - during integration tests, rails install.\n"
|
41
59
|
message += "It is UNEXPECTED if you are booting up a Hyrax powered application via `rails server'"
|
@@ -72,9 +90,9 @@ module Hyrax
|
|
72
90
|
ActiveFedora::Base.translate_uri_to_id = c.translate_uri_to_id
|
73
91
|
ActiveFedora::Base.translate_id_to_uri = c.translate_id_to_uri
|
74
92
|
|
75
|
-
Noid::Rails.config.template = c.noid_template
|
76
|
-
Noid::Rails.config.minter_class = c.noid_minter_class
|
77
|
-
Noid::Rails.config.statefile = c.minter_statefile
|
93
|
+
::Noid::Rails.config.template = c.noid_template
|
94
|
+
::Noid::Rails.config.minter_class = c.noid_minter_class
|
95
|
+
::Noid::Rails.config.statefile = c.minter_statefile
|
78
96
|
end
|
79
97
|
end
|
80
98
|
|
data/lib/hyrax/version.rb
CHANGED
@@ -35,4 +35,20 @@ RSpec.describe Hyrax::Actors::LeaseActor do
|
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
context 'deactivating an expired lease', clean_repo: true do
|
40
|
+
let(:lease_attributes) do
|
41
|
+
{ lease_date: Date.tomorrow.to_s,
|
42
|
+
current_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC,
|
43
|
+
future_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
44
|
+
end
|
45
|
+
let(:leased_work) { create(:leased_work, with_lease_attributes: lease_attributes) }
|
46
|
+
let(:subject) { described_class.new(leased_work) }
|
47
|
+
|
48
|
+
it 'destroys and reindexes the new permission appropriately in solr', with_nested_reindexing: true do
|
49
|
+
allow(leased_work.lease).to receive(:active?).and_return false
|
50
|
+
subject.destroy
|
51
|
+
expect(::SolrDocument.find(leased_work.id)[:visibility_ssi]).to eq(Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED)
|
52
|
+
end
|
53
|
+
end
|
38
54
|
end
|
@@ -20,7 +20,7 @@ RSpec.describe Hyrax::Admin::AppearancesController do
|
|
20
20
|
|
21
21
|
it "is successful" do
|
22
22
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
23
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
23
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
24
24
|
expect(controller).to receive(:add_breadcrumb).with('Configuration', '#')
|
25
25
|
expect(controller).to receive(:add_breadcrumb).with('Appearance', "/admin/appearance")
|
26
26
|
get :show
|
@@ -102,6 +102,7 @@ RSpec.describe Hyrax::Admin::CollectionTypesController, type: :controller, clean
|
|
102
102
|
nestable: true,
|
103
103
|
discoverable: true,
|
104
104
|
sharable: true,
|
105
|
+
brandable: true,
|
105
106
|
share_applies_to_new_works: true,
|
106
107
|
allow_multiple_membership: true,
|
107
108
|
require_membership: true,
|
@@ -241,6 +242,7 @@ RSpec.describe Hyrax::Admin::CollectionTypesController, type: :controller, clean
|
|
241
242
|
nestable: false,
|
242
243
|
discoverable: false,
|
243
244
|
sharable: false,
|
245
|
+
brandable: false,
|
244
246
|
share_applies_to_new_works: false,
|
245
247
|
allow_multiple_membership: false,
|
246
248
|
require_membership: true,
|
@@ -20,7 +20,7 @@ RSpec.describe Hyrax::Admin::FeaturesController do
|
|
20
20
|
|
21
21
|
it "is successful" do
|
22
22
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
23
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
23
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
24
24
|
expect(controller).to receive(:add_breadcrumb).with('Configuration', '#')
|
25
25
|
expect(controller).to receive(:add_breadcrumb).with('Features', admin_features_path)
|
26
26
|
get :index
|
@@ -7,7 +7,7 @@ RSpec.describe Hyrax::Admin::WorkflowRolesController do
|
|
7
7
|
|
8
8
|
it "is successful" do
|
9
9
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path(locale: 'en'))
|
10
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
10
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path(locale: 'en'))
|
11
11
|
expect(controller).to receive(:add_breadcrumb).with('Workflow Roles', admin_workflow_roles_path(locale: 'en'))
|
12
12
|
get :index
|
13
13
|
expect(response).to be_success
|
@@ -5,7 +5,7 @@ RSpec.describe Hyrax::Admin::WorkflowsController do
|
|
5
5
|
end
|
6
6
|
it "is successful" do
|
7
7
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
8
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
8
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
9
9
|
expect(controller).to receive(:add_breadcrumb).with('Tasks', '#')
|
10
10
|
expect(controller).to receive(:add_breadcrumb).with('Review Submissions', "/admin/workflows")
|
11
11
|
|
@@ -20,10 +20,12 @@ RSpec.describe Hyrax::BatchEditsController, type: :controller do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "is successful" do
|
23
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
23
24
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
24
25
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.my.works'), Hyrax::Engine.routes.url_helpers.my_works_path(locale: 'en'))
|
25
26
|
get :edit
|
26
27
|
expect(response).to be_successful
|
28
|
+
expect(response).to render_template('dashboard')
|
27
29
|
expect(assigns[:form].model.creator).to match_array ["Fred", "Wilma"]
|
28
30
|
end
|
29
31
|
end
|
@@ -42,9 +44,16 @@ RSpec.describe Hyrax::BatchEditsController, type: :controller do
|
|
42
44
|
create(:work, creator: ["Fred"], title: ["abc"], language: ['en'])
|
43
45
|
end
|
44
46
|
|
47
|
+
let!(:file_set) do
|
48
|
+
create(:file_set, creator: ["Fred"])
|
49
|
+
end
|
50
|
+
|
45
51
|
let(:mycontroller) { "hyrax/my/works" }
|
46
52
|
|
47
53
|
before do
|
54
|
+
one.members << file_set
|
55
|
+
one.save!
|
56
|
+
|
48
57
|
# TODO: why aren't we just submitting batch_document_ids[] as a parameter?
|
49
58
|
controller.batch = [one.id, two.id, three.id]
|
50
59
|
expect(controller).to receive(:can?).with(:edit, one.id).and_return(true)
|
@@ -76,7 +85,11 @@ RSpec.describe Hyrax::BatchEditsController, type: :controller do
|
|
76
85
|
it "updates permissions" do
|
77
86
|
put :update, params: { update_type: "update", visibility: "authenticated" }
|
78
87
|
expect(response).to be_redirect
|
79
|
-
|
88
|
+
|
89
|
+
work1 = GenericWork.find(one.id)
|
90
|
+
expect(work1.visibility).to eq "authenticated"
|
91
|
+
expect(work1.file_sets.map(&:visibility)).to eq ["authenticated"]
|
92
|
+
|
80
93
|
expect(GenericWork.find(two.id).visibility).to eq "authenticated"
|
81
94
|
expect(GenericWork.find(three.id).visibility).to eq "restricted"
|
82
95
|
end
|
@@ -105,10 +105,10 @@ RSpec.describe Hyrax::BatchUploadsController do
|
|
105
105
|
}
|
106
106
|
end
|
107
107
|
|
108
|
-
it 'redirects to
|
108
|
+
it 'redirects to managed works page' do
|
109
109
|
allow(BatchCreateJob).to receive(:perform_later)
|
110
110
|
post :create, params: post_params
|
111
|
-
expect(response).to redirect_to Hyrax::Engine.routes.url_helpers.
|
111
|
+
expect(response).to redirect_to Hyrax::Engine.routes.url_helpers.dashboard_works_path(locale: 'en')
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -11,7 +11,8 @@ RSpec.describe Hyrax::CitationsController do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "is successful" do
|
14
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
14
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
15
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
15
16
|
get :work, params: { id: work }
|
16
17
|
expect(response).to be_successful
|
17
18
|
expect(response).to render_template('layouts/hyrax/1_column')
|
@@ -39,7 +40,8 @@ RSpec.describe Hyrax::CitationsController do
|
|
39
40
|
end
|
40
41
|
|
41
42
|
it "is successful" do
|
42
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
43
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
44
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
43
45
|
get :file, params: { id: file_set }
|
44
46
|
expect(response).to be_successful
|
45
47
|
expect(response).to render_template('layouts/hyrax/1_column')
|
@@ -30,7 +30,8 @@ RSpec.describe Hyrax::CollectionsController do
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
it "returns the collection and its members"
|
33
|
+
it "returns the collection and its members" do # rubocop:disable RSpec/ExampleLength
|
34
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
34
35
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
35
36
|
get :show, params: { id: collection }
|
36
37
|
expect(response).to be_successful
|
@@ -43,7 +44,7 @@ RSpec.describe Hyrax::CollectionsController do
|
|
43
44
|
expect(assigns[:subcollection_count]).to eq(2)
|
44
45
|
end
|
45
46
|
|
46
|
-
context "and searching"
|
47
|
+
context "and searching" do
|
47
48
|
it "returns some works and subcollections" do
|
48
49
|
# "/collections/4m90dv529?utf8=%E2%9C%93&cq=King+Louie&sort="
|
49
50
|
get :show, params: { id: collection, cq: "Second" }
|
@@ -66,6 +67,7 @@ RSpec.describe Hyrax::CollectionsController do
|
|
66
67
|
|
67
68
|
context "without a referer" do
|
68
69
|
it "sets breadcrumbs" do
|
70
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
69
71
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
70
72
|
get :show, params: { id: collection }
|
71
73
|
expect(response).to be_successful
|
@@ -78,8 +80,9 @@ RSpec.describe Hyrax::CollectionsController do
|
|
78
80
|
end
|
79
81
|
|
80
82
|
it "sets breadcrumbs" do
|
81
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
82
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
83
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
84
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
85
|
+
expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
|
83
86
|
expect(controller).to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'))
|
84
87
|
get :show, params: { id: collection }
|
85
88
|
expect(response).to be_successful
|
@@ -94,5 +97,30 @@ RSpec.describe Hyrax::CollectionsController do
|
|
94
97
|
expect(assigns[:subcollection_docs].count).to eq 0
|
95
98
|
end
|
96
99
|
end
|
100
|
+
|
101
|
+
context "without a referer" do
|
102
|
+
it "sets breadcrumbs" do
|
103
|
+
expect(controller).not_to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
104
|
+
expect(controller).not_to receive(:add_breadcrumb).with('Your Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
|
105
|
+
expect(controller).not_to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'))
|
106
|
+
|
107
|
+
get :show, params: { id: collection }
|
108
|
+
expect(response).to be_successful
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context "with a referer" do
|
113
|
+
before do
|
114
|
+
request.env['HTTP_REFERER'] = 'http://test.host/foo'
|
115
|
+
end
|
116
|
+
|
117
|
+
it "sets breadcrumbs" do
|
118
|
+
expect(controller).not_to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
119
|
+
expect(controller).not_to receive(:add_breadcrumb).with('Your Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
|
120
|
+
expect(controller).to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'))
|
121
|
+
get :show, params: { id: collection }
|
122
|
+
expect(response).to be_successful
|
123
|
+
end
|
124
|
+
end
|
97
125
|
end
|
98
126
|
end
|
@@ -37,7 +37,7 @@ RSpec.describe Hyrax::ContentBlocksController, type: :controller do
|
|
37
37
|
describe "GET #edit" do
|
38
38
|
it "renders breadcrumbs" do
|
39
39
|
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
40
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
40
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
41
41
|
expect(controller).to receive(:add_breadcrumb).with('Configuration', '#')
|
42
42
|
expect(controller).to receive(:add_breadcrumb).with('Content Blocks', edit_content_blocks_path)
|
43
43
|
get :edit
|
@@ -305,7 +305,8 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
305
305
|
end
|
306
306
|
end
|
307
307
|
|
308
|
-
it "returns the collection and its members"
|
308
|
+
it "returns the collection and its members" do
|
309
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
309
310
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
310
311
|
get :show, params: { id: collection }
|
311
312
|
expect(response).to be_successful
|
@@ -317,7 +318,7 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
317
318
|
expect(assigns[:subcollection_count]).to eq(2)
|
318
319
|
end
|
319
320
|
|
320
|
-
context "and searching"
|
321
|
+
context "and searching" do
|
321
322
|
it "returns some works and collections" do
|
322
323
|
# "/dashboard/collections/4m90dv529?utf8=%E2%9C%93&cq=King+Louie&sort="
|
323
324
|
get :show, params: { id: collection, cq: "Second" }
|
@@ -340,6 +341,7 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
340
341
|
|
341
342
|
context "without a referer" do
|
342
343
|
it "sets breadcrumbs" do
|
344
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
343
345
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
344
346
|
get :show, params: { id: collection }
|
345
347
|
expect(response).to be_successful
|
@@ -352,8 +354,9 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
352
354
|
end
|
353
355
|
|
354
356
|
it "sets breadcrumbs" do
|
355
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
356
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
357
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
358
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
359
|
+
expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
|
357
360
|
expect(controller).to receive(:add_breadcrumb).with('My collection', collection_path(collection.id, locale: 'en'))
|
358
361
|
get :show, params: { id: collection }
|
359
362
|
expect(response).to be_successful
|
@@ -436,6 +439,7 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
436
439
|
|
437
440
|
context "without a referer" do
|
438
441
|
it "sets breadcrumbs" do
|
442
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
439
443
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t('hyrax.dashboard.title'), Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
440
444
|
get :edit, params: { id: collection }
|
441
445
|
expect(response).to be_successful
|
@@ -448,8 +452,9 @@ RSpec.describe Hyrax::Dashboard::CollectionsController, :clean_repo do
|
|
448
452
|
end
|
449
453
|
|
450
454
|
it "sets breadcrumbs" do
|
451
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
452
|
-
expect(controller).to receive(:add_breadcrumb).with('
|
455
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', Hyrax::Engine.routes.url_helpers.root_path(locale: 'en'))
|
456
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', Hyrax::Engine.routes.url_helpers.dashboard_path(locale: 'en'))
|
457
|
+
expect(controller).to receive(:add_breadcrumb).with('Collections', Hyrax::Engine.routes.url_helpers.my_collections_path(locale: 'en'))
|
453
458
|
expect(controller).to receive(:add_breadcrumb).with(I18n.t("hyrax.collection.browse_view"), collection_path(collection.id, locale: 'en'))
|
454
459
|
get :edit, params: { id: collection }
|
455
460
|
expect(response).to be_successful
|
@@ -68,6 +68,17 @@ RSpec.describe Hyrax::DepositorsController do
|
|
68
68
|
expect { delete :destroy, params: revoke_proxy_params }.to change { ProxyDepositRights.count }.by(-1)
|
69
69
|
end
|
70
70
|
end
|
71
|
+
|
72
|
+
describe "index" do
|
73
|
+
it "renders the page with user proxy info" do
|
74
|
+
expect(controller).to receive(:add_breadcrumb).with('Home', root_path)
|
75
|
+
expect(controller).to receive(:add_breadcrumb).with('Dashboard', dashboard_path)
|
76
|
+
expect(controller).to receive(:add_breadcrumb).with('Manage Proxies', depositors_path)
|
77
|
+
get :index
|
78
|
+
expect(response).to be_successful
|
79
|
+
expect(response).to render_template('dashboard')
|
80
|
+
end
|
81
|
+
end
|
71
82
|
end
|
72
83
|
|
73
84
|
context "as a user without access" do
|