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/spec/factories/file_sets.rb
CHANGED
@@ -9,9 +9,7 @@ FactoryBot.define do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:create) do |file, evaluator|
|
12
|
-
if evaluator.content
|
13
|
-
Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
|
14
|
-
end
|
12
|
+
Hydra::Works::UploadFileToFileSet.call(file, evaluator.content) if evaluator.content
|
15
13
|
end
|
16
14
|
|
17
15
|
trait :public do
|
@@ -27,9 +25,7 @@ FactoryBot.define do
|
|
27
25
|
file.title = ['testfile']
|
28
26
|
end
|
29
27
|
after(:create) do |file, evaluator|
|
30
|
-
if evaluator.content
|
31
|
-
Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
|
32
|
-
end
|
28
|
+
Hydra::Works::UploadFileToFileSet.call(file, evaluator.content) if evaluator.content
|
33
29
|
create(:work, user: evaluator.user).members << file
|
34
30
|
end
|
35
31
|
end
|
@@ -88,31 +88,95 @@ FactoryBot.define do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
factory :with_embargo_date do
|
91
|
+
# build with defaults:
|
92
|
+
# let(:work) { create(:embargoed_work) }
|
93
|
+
|
94
|
+
# build with specific values:
|
95
|
+
# let(:embargo_attributes) do
|
96
|
+
# { embargo_date: Date.tomorrow.to_s,
|
97
|
+
# current_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE,
|
98
|
+
# future_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
99
|
+
# end
|
100
|
+
# let(:work) { create(:embargoed_work, with_embargo_attributes: embargo_attributes) }
|
101
|
+
|
91
102
|
transient do
|
103
|
+
with_embargo_attributes false
|
92
104
|
embargo_date { Date.tomorrow.to_s }
|
93
105
|
current_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
94
106
|
future_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
95
107
|
end
|
96
108
|
factory :embargoed_work do
|
97
|
-
after(:build)
|
109
|
+
after(:build) do |work, evaluator|
|
110
|
+
if evaluator.with_embargo_attributes
|
111
|
+
work.apply_embargo(evaluator.with_embargo_attributes[:embargo_date],
|
112
|
+
evaluator.with_embargo_attributes[:current_state],
|
113
|
+
evaluator.with_embargo_attributes[:future_state])
|
114
|
+
else
|
115
|
+
work.apply_embargo(evaluator.embargo_date,
|
116
|
+
evaluator.current_state,
|
117
|
+
evaluator.future_state)
|
118
|
+
end
|
119
|
+
end
|
98
120
|
end
|
99
121
|
factory :embargoed_work_with_files do
|
100
|
-
after(:build)
|
122
|
+
after(:build) do |work, evaluator|
|
123
|
+
if evaluator.with_embargo_attributes
|
124
|
+
work.apply_embargo(evaluator.with_embargo_attributes[:embargo_date],
|
125
|
+
evaluator.with_embargo_attributes[:current_state],
|
126
|
+
evaluator.with_embargo_attributes[:future_state])
|
127
|
+
else
|
128
|
+
work.apply_embargo(evaluator.embargo_date,
|
129
|
+
evaluator.current_state,
|
130
|
+
evaluator.future_state)
|
131
|
+
end
|
132
|
+
end
|
101
133
|
after(:create) { |work, evaluator| 2.times { work.ordered_members << create(:file_set, user: evaluator.user) } }
|
102
134
|
end
|
103
135
|
end
|
104
136
|
|
105
137
|
factory :with_lease_date do
|
138
|
+
# build with defaults:
|
139
|
+
# let(:work) { create(:leased_work) }
|
140
|
+
|
141
|
+
# build with specific values:
|
142
|
+
# let(:lease_attributes) do
|
143
|
+
# { lease_date: Date.tomorrow.to_s,
|
144
|
+
# current_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC,
|
145
|
+
# future_state: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_AUTHENTICATED }
|
146
|
+
# end
|
147
|
+
# let(:work) { create(:leased_work, with_lease_attributes: lease_attributes) }
|
148
|
+
|
106
149
|
transient do
|
150
|
+
with_lease_attributes false
|
107
151
|
lease_date { Date.tomorrow.to_s }
|
108
152
|
current_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC }
|
109
153
|
future_state { Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PRIVATE }
|
110
154
|
end
|
111
155
|
factory :leased_work do
|
112
|
-
after(:build)
|
156
|
+
after(:build) do |work, evaluator|
|
157
|
+
if evaluator.with_lease_attributes
|
158
|
+
work.apply_lease(evaluator.with_lease_attributes[:lease_date],
|
159
|
+
evaluator.with_lease_attributes[:current_state],
|
160
|
+
evaluator.with_lease_attributes[:future_state])
|
161
|
+
else
|
162
|
+
work.apply_lease(evaluator.lease_date,
|
163
|
+
evaluator.current_state,
|
164
|
+
evaluator.future_state)
|
165
|
+
end
|
166
|
+
end
|
113
167
|
end
|
114
168
|
factory :leased_work_with_files do
|
115
|
-
after(:build)
|
169
|
+
after(:build) do |work, evaluator|
|
170
|
+
if evaluator.with_lease_attributes
|
171
|
+
work.apply_lease(evaluator.with_lease_attributes[:lease_date],
|
172
|
+
evaluator.with_lease_attributes[:current_state],
|
173
|
+
evaluator.with_lease_attributes[:future_state])
|
174
|
+
else
|
175
|
+
work.apply_lease(evaluator.lease_date,
|
176
|
+
evaluator.current_state,
|
177
|
+
evaluator.future_state)
|
178
|
+
end
|
179
|
+
end
|
116
180
|
after(:create) { |work, evaluator| 2.times { work.ordered_members << create(:file_set, user: evaluator.user) } }
|
117
181
|
end
|
118
182
|
end
|
@@ -29,9 +29,10 @@ RSpec.describe 'Collections Factory' do # rubocop:disable RSpec/DescribeClass
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'will create a collection type with specified settings when collection_type_settings is set to attributes identifying settings' do
|
32
|
-
col = build(:collection_lw, collection_type_settings: [:not_discoverable, :not_sharable, :nestable])
|
32
|
+
col = build(:collection_lw, collection_type_settings: [:not_discoverable, :not_sharable, :not_brandable, :nestable])
|
33
33
|
expect(col.collection_type.discoverable?).to be false
|
34
34
|
expect(col.collection_type.sharable?).to be false
|
35
|
+
expect(col.collection_type.brandable?).to be false
|
35
36
|
expect(col.collection_type.nestable?).to be true
|
36
37
|
end
|
37
38
|
end
|
@@ -2,8 +2,19 @@
|
|
2
2
|
|
3
3
|
RSpec.describe 'Batch creation of works', type: :feature do
|
4
4
|
let(:user) { create(:user) }
|
5
|
+
let!(:default_admin_set) do
|
6
|
+
build(:admin_set,
|
7
|
+
id: AdminSet::DEFAULT_ID,
|
8
|
+
title: ["Default Admin Set"],
|
9
|
+
description: ["A description"],
|
10
|
+
with_permission_template: { deposit_groups: [::Ability.registered_group_name] })
|
11
|
+
end
|
5
12
|
|
6
13
|
before do
|
14
|
+
# stub out characterization and derivatives. Travis doesn't have fits installed, and it's not relevant to the test.
|
15
|
+
allow(CharacterizeJob).to receive(:perform_later)
|
16
|
+
allow(CreateDerivativesJob).to receive(:perform_later)
|
17
|
+
|
7
18
|
sign_in user
|
8
19
|
end
|
9
20
|
|
@@ -15,4 +26,53 @@ RSpec.describe 'Batch creation of works', type: :feature do
|
|
15
26
|
end
|
16
27
|
expect(page).to have_content("Each file will be uploaded to a separate new work resulting in one work per uploaded file.")
|
17
28
|
end
|
29
|
+
|
30
|
+
context 'when the user is a proxy', :js, :workflow do
|
31
|
+
let(:second_user) { create(:user) }
|
32
|
+
|
33
|
+
before do
|
34
|
+
ProxyDepositRights.create!(grantor: second_user, grantee: user)
|
35
|
+
sign_in user
|
36
|
+
click_link 'Works'
|
37
|
+
click_link "Create batch of works"
|
38
|
+
choose "payload_concern", option: "GenericWork"
|
39
|
+
click_button 'Create work'
|
40
|
+
end
|
41
|
+
|
42
|
+
it "allows on-behalf-of batch deposit", :js do
|
43
|
+
click_link "Files" # switch tab
|
44
|
+
expect(page).to have_content "Add files"
|
45
|
+
within('span#addfiles') do
|
46
|
+
# two arbitrary files that aren't actually related, but should be
|
47
|
+
# small enough to require minimal processessing.
|
48
|
+
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/small_file.txt", visible: false)
|
49
|
+
attach_file("files[]", "#{Hyrax::Engine.root}/spec/fixtures/png_fits.xml", visible: false)
|
50
|
+
end
|
51
|
+
click_link "Descriptions" # switch tab
|
52
|
+
fill_in('Creator', with: 'Doe, Jane')
|
53
|
+
fill_in('Keyword', with: 'testing')
|
54
|
+
select('In Copyright', from: 'Rights statement')
|
55
|
+
# With selenium and the chrome driver, focus remains on the
|
56
|
+
# select box. Click outside the box so the next line can't find
|
57
|
+
# its element
|
58
|
+
find('body').click
|
59
|
+
|
60
|
+
choose('batch_upload_item_visibility_open')
|
61
|
+
expect(page).to have_content('Please note, making something visible to the world (i.e. marking this as Public) may be viewed as publishing which could impact your ability to')
|
62
|
+
select(second_user.user_key, from: 'On behalf of')
|
63
|
+
check('agreement')
|
64
|
+
click_on('Save')
|
65
|
+
|
66
|
+
# Expect the proxy depositor (grantor) to be able to see both uploaded files.
|
67
|
+
expect(page).to have_content 'small_file.txt'
|
68
|
+
expect(page).to have_content 'png_fits.xml'
|
69
|
+
|
70
|
+
# Sign in with the grantee user, and expect to see the works deposited
|
71
|
+
# on their behalf.
|
72
|
+
sign_in second_user
|
73
|
+
click_link 'Works'
|
74
|
+
expect(page).to have_content 'small_file.txt'
|
75
|
+
expect(page).to have_content 'png_fits.xml'
|
76
|
+
end
|
77
|
+
end
|
18
78
|
end
|
@@ -65,6 +65,7 @@ RSpec.describe 'batch', type: :feature, clean_repo: true, js: true do
|
|
65
65
|
describe 'deleting' do
|
66
66
|
it 'destroys the selected works' do
|
67
67
|
accept_confirm { click_button 'Delete Selected' }
|
68
|
+
expect(page).to have_content('Batch delete complete')
|
68
69
|
expect(GenericWork.count).to be_zero
|
69
70
|
end
|
70
71
|
end
|
@@ -50,6 +50,7 @@ RSpec.describe "Browse Dashboard", type: :feature do
|
|
50
50
|
first('input#check_all').click
|
51
51
|
expect do
|
52
52
|
accept_confirm { click_button('Delete Selected') }
|
53
|
+
expect(page).to have_content('Batch delete complete')
|
53
54
|
end.to change { GenericWork.count }.by(-3)
|
54
55
|
end
|
55
56
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
RSpec.describe 'Adding a work to multiple collections', type: :feature, clean_repo: true, js: true
|
1
|
+
RSpec.describe 'Adding a work to multiple collections', type: :feature, clean_repo: true, js: true do
|
2
2
|
let(:admin_user) { create(:admin, email: 'admin@example.com') }
|
3
3
|
let(:single_membership_type_1) { create(:collection_type, :not_allow_multiple_membership, title: 'Single-membership 1') }
|
4
4
|
let(:single_membership_type_2) { create(:collection_type, :not_allow_multiple_membership, title: 'Single-membership 2') }
|
@@ -94,8 +94,10 @@ RSpec.describe 'Adding a work to multiple collections', type: :feature, clean_re
|
|
94
94
|
click_button 'Save changes'
|
95
95
|
end
|
96
96
|
# forwards to collections index page and shows flash message
|
97
|
-
|
98
|
-
|
97
|
+
within('section.tabs-row') do
|
98
|
+
expect(page).to have_link 'All Collections'
|
99
|
+
expect(page).to have_link 'Your Collections'
|
100
|
+
end
|
99
101
|
|
100
102
|
err_message = "Error: You have specified more than one of the same single-membership collection types: " \
|
101
103
|
"Single-membership 1 (#{new_collection.title.first} and #{old_collection.title.first})"
|
@@ -129,9 +131,10 @@ RSpec.describe 'Adding a work to multiple collections', type: :feature, clean_re
|
|
129
131
|
click_button 'Save changes'
|
130
132
|
end
|
131
133
|
# forwards to collections index page and shows flash message
|
132
|
-
|
133
|
-
|
134
|
-
|
134
|
+
within('section.tabs-row') do
|
135
|
+
expect(page).to have_link 'All Collections'
|
136
|
+
expect(page).to have_link 'Your Collections'
|
137
|
+
end
|
135
138
|
err_message = "Error: You have specified more than one of the same single-membership collection types: " \
|
136
139
|
"Single-membership 1 (#{new_collection.title.first} and #{old_collection.title.first})"
|
137
140
|
expect(page).to have_selector '.alert', text: err_message
|
@@ -69,6 +69,50 @@ RSpec.describe 'collection_type', type: :feature, clean_repo: true do
|
|
69
69
|
expect(page).to have_link('Settings', href: '#settings')
|
70
70
|
expect(page).to have_link('Participants', href: '#participants')
|
71
71
|
end
|
72
|
+
|
73
|
+
it 'tries to make a collection type with existing title, and receives error message', :js do
|
74
|
+
click_link 'Create new collection type'
|
75
|
+
|
76
|
+
expect(page).to have_content 'Create New Collection Type'
|
77
|
+
|
78
|
+
# confirm only Description tab is visible
|
79
|
+
expect(page).to have_link('Description', href: '#metadata')
|
80
|
+
expect(page).not_to have_link('Settings', href: '#settings')
|
81
|
+
expect(page).not_to have_link('Participants', href: '#participants')
|
82
|
+
|
83
|
+
# confirm metadata fields exist
|
84
|
+
expect(page).to have_selector 'input#collection_type_title'
|
85
|
+
expect(page).to have_selector 'textarea#collection_type_description'
|
86
|
+
|
87
|
+
# set values and save
|
88
|
+
fill_in('Type name', with: title)
|
89
|
+
fill_in('Type description', with: description)
|
90
|
+
|
91
|
+
click_button('Save')
|
92
|
+
|
93
|
+
visit '/admin/collection_types'
|
94
|
+
click_link 'Create new collection type'
|
95
|
+
|
96
|
+
expect(page).to have_content 'Create New Collection Type'
|
97
|
+
|
98
|
+
# confirm only Description tab is visible
|
99
|
+
expect(page).to have_link('Description', href: '#metadata')
|
100
|
+
expect(page).not_to have_link('Settings', href: '#settings')
|
101
|
+
expect(page).not_to have_link('Participants', href: '#participants')
|
102
|
+
|
103
|
+
# confirm metadata fields exist
|
104
|
+
expect(page).to have_selector 'input#collection_type_title'
|
105
|
+
expect(page).to have_selector 'textarea#collection_type_description'
|
106
|
+
|
107
|
+
# set values and save
|
108
|
+
fill_in('Type name', with: title)
|
109
|
+
fill_in('Type description', with: description)
|
110
|
+
|
111
|
+
click_button('Save')
|
112
|
+
|
113
|
+
# Confirm error message is displayed.
|
114
|
+
expect(page).to have_content 'Save was not successful because title has already been taken, and machine_id has already been taken.'
|
115
|
+
end
|
72
116
|
end
|
73
117
|
|
74
118
|
describe 'edit collection type' do
|
@@ -112,6 +156,7 @@ RSpec.describe 'collection_type', type: :feature, clean_repo: true do
|
|
112
156
|
|
113
157
|
# confirm all non-admin_set checkboxes are on
|
114
158
|
expect(page).to have_checked_field('collection_type_nestable')
|
159
|
+
expect(page).to have_checked_field('collection_type_brandable')
|
115
160
|
expect(page).to have_checked_field('collection_type_discoverable')
|
116
161
|
expect(page).to have_checked_field('collection_type_sharable')
|
117
162
|
expect(page).to have_checked_field('collection_type_share_applies_to_new_works')
|
@@ -123,13 +168,14 @@ RSpec.describe 'collection_type', type: :feature, clean_repo: true do
|
|
123
168
|
expect(page).to have_unchecked_field('collection_type_assigns_visibility', disabled: true)
|
124
169
|
|
125
170
|
# change settings
|
126
|
-
page.uncheck('
|
171
|
+
page.uncheck('NESTING')
|
127
172
|
page.uncheck('DISCOVERY')
|
128
173
|
page.check('APPLY TO NEW WORKS')
|
129
174
|
page.uncheck('MULTIPLE MEMBERSHIP')
|
130
175
|
|
131
176
|
# confirm all non-admin_set checkboxes are now off
|
132
177
|
expect(page).to have_unchecked_field('collection_type_nestable')
|
178
|
+
expect(page).to have_checked_field('collection_type_brandable')
|
133
179
|
expect(page).to have_unchecked_field('collection_type_discoverable')
|
134
180
|
expect(page).to have_checked_field('collection_type_sharable')
|
135
181
|
expect(page).to have_checked_field('collection_type_share_applies_to_new_works')
|
@@ -187,6 +233,7 @@ RSpec.describe 'collection_type', type: :feature, clean_repo: true do
|
|
187
233
|
|
188
234
|
# confirm default user collection checkboxes are set to appropriate values
|
189
235
|
expect(page).to have_checked_field('collection_type_nestable', disabled: true)
|
236
|
+
expect(page).to have_checked_field('collection_type_brandable', disabled: true)
|
190
237
|
expect(page).to have_checked_field('collection_type_discoverable', disabled: true)
|
191
238
|
expect(page).to have_checked_field('collection_type_sharable', disabled: true)
|
192
239
|
expect(page).to have_unchecked_field('collection_type_share_applies_to_new_works', disabled: true)
|
@@ -260,6 +307,7 @@ RSpec.describe 'collection_type', type: :feature, clean_repo: true do
|
|
260
307
|
|
261
308
|
# confirm all checkboxes are disabled
|
262
309
|
expect(page).to have_field('collection_type_nestable', disabled: true)
|
310
|
+
expect(page).to have_field('collection_type_brandable', disabled: true)
|
263
311
|
expect(page).to have_field('collection_type_discoverable', disabled: true)
|
264
312
|
expect(page).to have_field('collection_type_sharable', disabled: true)
|
265
313
|
expect(page).to have_field('collection_type_share_applies_to_new_works', disabled: true)
|
@@ -7,7 +7,7 @@ RSpec.describe 'Creating a new Work as admin', :js, :workflow do
|
|
7
7
|
edit_users: [user.user_key])
|
8
8
|
end
|
9
9
|
let(:admin_set_2) do
|
10
|
-
create(:admin_set, title: ["
|
10
|
+
create(:admin_set, title: ["Another Admin Set"],
|
11
11
|
description: ["A description"],
|
12
12
|
edit_users: [user.user_key])
|
13
13
|
end
|
@@ -35,7 +35,7 @@ RSpec.describe 'Creating a new Work as admin', :js, :workflow do
|
|
35
35
|
click_button 'Create work'
|
36
36
|
click_link "Relationship" # switch tab
|
37
37
|
expect(page).to have_content('Administrative Set')
|
38
|
-
expect(page).to have_content('
|
38
|
+
expect(page).to have_content('Another Admin Set')
|
39
39
|
expect(page).to have_content('Default Admin Set')
|
40
40
|
expect(page).to have_selector('select#generic_work_admin_set_id')
|
41
41
|
expect(page).to have_select('generic_work_admin_set_id', selected: 'Default Admin Set')
|
@@ -1,5 +1,6 @@
|
|
1
1
|
RSpec.describe 'Creating a new Work', :js, :workflow do
|
2
2
|
let(:user) { create(:user) }
|
3
|
+
let!(:ability) { ::Ability.new(user) }
|
3
4
|
let(:file1) { File.open(fixture_path + '/world.png') }
|
4
5
|
let(:file2) { File.open(fixture_path + '/image.jp2') }
|
5
6
|
let!(:uploaded_file1) { Hyrax::UploadedFile.create(file: file1, user: user) }
|
@@ -1,6 +1,8 @@
|
|
1
1
|
RSpec.describe "As an admin user I should be able to see all works" do
|
2
|
-
let!(:work1) { create(:work, title: ['Testing #1']) }
|
3
|
-
let!(:work2) { create(:work, title: ['Testing #2']) }
|
2
|
+
let!(:work1) { create(:work, title: ['Testing #1'], admin_set: adminset, member_of_collections: [collection]) }
|
3
|
+
let!(:work2) { create(:work, title: ['Testing #2'], admin_set: adminset, member_of_collections: [collection]) }
|
4
|
+
let(:collection) { build(:collection_lw, with_solr_document: true) }
|
5
|
+
let(:adminset) { create(:admin_set) }
|
4
6
|
|
5
7
|
before do
|
6
8
|
sign_in create(:admin)
|
@@ -10,5 +12,11 @@ RSpec.describe "As an admin user I should be able to see all works" do
|
|
10
12
|
expect(page).to have_content 'Works'
|
11
13
|
expect(page).to have_content 'Testing #1'
|
12
14
|
expect(page).to have_content 'Testing #2'
|
15
|
+
|
16
|
+
# check for filters
|
17
|
+
expect(page).to have_button('Collection')
|
18
|
+
expect(page).to have_link(collection.title.first, class: 'facet_select')
|
19
|
+
expect(page).to have_button('Admin Set')
|
20
|
+
expect(page).to have_link(adminset.title.first, class: 'facet_select')
|
13
21
|
end
|
14
22
|
end
|
@@ -1,4 +1,6 @@
|
|
1
1
|
RSpec.describe 'collection', type: :feature, clean_repo: true do
|
2
|
+
include Selectors::Dashboard
|
3
|
+
|
2
4
|
let(:user) { create(:user) }
|
3
5
|
let(:admin_user) { create(:admin) }
|
4
6
|
let(:collection_type) { create(:collection_type, creator_user: user) }
|
@@ -37,7 +39,9 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
37
39
|
it "has page title, does not have tabs, and lists only user's collections" do
|
38
40
|
expect(page).to have_content 'Collections'
|
39
41
|
expect(page).not_to have_link 'All Collections'
|
40
|
-
|
42
|
+
within('section.tabs-row') do
|
43
|
+
expect(page).not_to have_link 'Your Collections'
|
44
|
+
end
|
41
45
|
expect(page).to have_link(collection1.title.first)
|
42
46
|
expect(page).to have_link(collection2.title.first)
|
43
47
|
expect(page).to have_link(admin_set_b.title.first)
|
@@ -85,7 +89,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
85
89
|
visit '/dashboard/my/collections'
|
86
90
|
end
|
87
91
|
|
88
|
-
it "has page title, has tabs for All and Your Collections, and lists collections with edit access" do
|
92
|
+
it "has page title, has tabs for All Collections and Your Collections, and lists collections with edit access" do
|
89
93
|
expect(page).to have_content 'Collections'
|
90
94
|
expect(page).to have_link 'All Collections'
|
91
95
|
expect(page).to have_link 'Your Collections'
|
@@ -128,7 +132,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
128
132
|
visit '/dashboard/my/collections'
|
129
133
|
end
|
130
134
|
|
131
|
-
it 'lists all collections for all users'
|
135
|
+
it 'lists all collections for all users' do
|
132
136
|
expect(page).to have_link 'All Collection'
|
133
137
|
click_link 'All Collections'
|
134
138
|
expect(page).to have_link(collection1.title.first)
|
@@ -293,6 +297,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
293
297
|
end
|
294
298
|
end
|
295
299
|
|
300
|
+
# TODO: this section is still deactivated
|
296
301
|
describe "adding works to a collection", skip: "we need to define a dashboard/works path" do
|
297
302
|
let!(:collection) { create!(:collection, title: ["Barrel of monkeys"], user: user, with_permission_template: true) }
|
298
303
|
let!(:work1) { create(:work, title: ["King Louie"], user: user) }
|
@@ -531,7 +536,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
531
536
|
end
|
532
537
|
end
|
533
538
|
|
534
|
-
describe 'collection show page'
|
539
|
+
describe 'collection show page' do
|
535
540
|
let(:collection) do
|
536
541
|
create(:public_collection, user: user, description: ['collection description'], create_access: true)
|
537
542
|
end
|
@@ -662,7 +667,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
662
667
|
end
|
663
668
|
|
664
669
|
# TODO: this is just like the block above. Merge them.
|
665
|
-
describe 'show pages of a collection'
|
670
|
+
describe 'show pages of a collection' do
|
666
671
|
before do
|
667
672
|
docs = (0..12).map do |n|
|
668
673
|
{ "has_model_ssim" => ["GenericWork"], :id => "zs25x871q#{n}",
|
@@ -690,7 +695,7 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
690
695
|
end
|
691
696
|
|
692
697
|
describe 'remove works from collection' do
|
693
|
-
context 'user that can edit'
|
698
|
+
context 'user that can edit' do
|
694
699
|
let!(:work2) { create(:work, title: ["King Louie"], member_of_collections: [collection1], user: user) }
|
695
700
|
let!(:work1) { create(:work, title: ["King Kong"], member_of_collections: [collection1], user: user) }
|
696
701
|
|
@@ -779,14 +784,6 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
779
784
|
expect(page).to have_field('collection_title', with: collection.title.first)
|
780
785
|
expect(page).to have_field('collection_description', with: collection.description.first)
|
781
786
|
|
782
|
-
# TODO: These two expectations require the spec to include with_nested_reindexing: true.
|
783
|
-
# However, adding nested indexing causes this spec to fail to go through the update method
|
784
|
-
# in the controller unless js: true is also included. Including javascript greatly increases
|
785
|
-
# the time required for the spec to complete, so for now, I am simply commenting out these
|
786
|
-
# two expectations, as these are not integral to the function being tested.
|
787
|
-
# expect(page).to have_content(work1.title.first)
|
788
|
-
# expect(page).to have_content(work2.title.first)
|
789
|
-
|
790
787
|
new_title = "Altered Title"
|
791
788
|
new_description = "Completely new Description text."
|
792
789
|
creators = ["Dorje Trollo", "Vajrayogini"]
|
@@ -832,9 +829,19 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
832
829
|
sign_in user
|
833
830
|
end
|
834
831
|
|
835
|
-
|
836
|
-
|
837
|
-
|
832
|
+
context 'with brandable set' do
|
833
|
+
let(:brandable_collection_id) { create(:collection, user: user, collection_type_settings: [:brandable], create_access: true).id }
|
834
|
+
let(:not_brandable_collection_id) { create(:collection, user: user, collection_type_settings: [:not_brandable], create_access: true).id }
|
835
|
+
|
836
|
+
it 'to true, it shows Branding tab' do
|
837
|
+
visit "/dashboard/collections/#{brandable_collection_id}/edit"
|
838
|
+
expect(page).to have_link('Branding', href: '#branding')
|
839
|
+
end
|
840
|
+
|
841
|
+
it 'to false, it hides Branding tab' do
|
842
|
+
visit "/dashboard/collections/#{not_brandable_collection_id}/edit"
|
843
|
+
expect(page).not_to have_link('Branding', href: '#branding')
|
844
|
+
end
|
838
845
|
end
|
839
846
|
|
840
847
|
context 'with discoverable set' do
|
@@ -861,6 +868,20 @@ RSpec.describe 'collection', type: :feature, clean_repo: true do
|
|
861
868
|
expect(page).to have_link('Sharing', href: '#sharing')
|
862
869
|
end
|
863
870
|
|
871
|
+
context "to true, limits available users", js: true do
|
872
|
+
let(:user2) { create(:user) }
|
873
|
+
it "to system users filted by select2" do
|
874
|
+
visit "/dashboard/collections/#{sharable_collection_id}/edit"
|
875
|
+
expect(page).to have_link('Sharing', href: '#sharing')
|
876
|
+
click_link('Sharing')
|
877
|
+
expect(page).to have_selector(".form-inline.add-users .select2-container")
|
878
|
+
select_user(user2, 'Depositor')
|
879
|
+
click_button('Save')
|
880
|
+
click_link('Sharing')
|
881
|
+
expect(page).to have_selector('td', text: user2.user_key)
|
882
|
+
end
|
883
|
+
end
|
884
|
+
|
864
885
|
it 'to false, it hides Sharable tab' do
|
865
886
|
visit "/dashboard/collections/#{not_sharable_collection_id}/edit"
|
866
887
|
expect(page).not_to have_link('Sharing', href: '#sharing')
|