samvera / hyrax

Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
http://hyrax.samvera.org/
Apache License 2.0
182 stars 122 forks source link

Address valkyrie derivative issues #6795

Closed laritakr closed 1 month ago

laritakr commented 1 month ago

Valkyrie derivatives sort of work but only by accident. We need to access them via the storage adapter, rather than assuming we will find them on the file system. This begins the process of accessing derivatives appropriately.

The idea is to always include the options to download derivatives on the actions dropdown.

The actions download menu does not have a Hyrax::FileSet object... it has a Hyrax::IiifAv::IiifFileSetPresenter object (at least when we are using IiifPrint). The extensions_and_mime_types method we added to the fileset gives us an array of hashes that we can use for the actions dropdown:

 [{:id=>"123", :extension=>"pdf", :mime_type=>"application/pdf", :name=>nil, :use=>"OriginalFile"},
    #    {:id=>"234", :extension=>"jpeg", :mime_type=>"application/octet-stream", :name=>"thumbnail", :use=>"ThumbnailImage"}]
Screenshots ![Screenshot 2024-05-15 at 4 42 42 PM](https://github.com/samvera/hyrax/assets/17851674/d94317a4-4988-4413-8658-4224af361ded) ![Screenshot 2024-05-15 at 4 42 51 PM](https://github.com/samvera/hyrax/assets/17851674/810e146c-97b5-481d-854b-943d843c2ebd)
github-actions[bot] commented 1 month ago

Test Results

    9 files  ±0      9 suites  ±0   17m 34s :stopwatch: +20s 4 763 tests +1  4 700 :white_check_mark: +1  63 :zzz: ±0  0 :x: ±0  6 489 runs  +1  6 426 :white_check_mark: +1  63 :zzz: ±0  0 :x: ±0 

Results for commit 4623c640. ± Comparison against base commit 943b0027.

This pull request removes 93 and adds 94 tests. Note that renamed tests count towards both. ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: a8d40e47-6f61-4d6b-9050-aa86a9b34d52 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 381e26db-e592-4542-8d30-6ffdc930924f spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: de3f2604-150c-4fef-8baa-11401d65e6ba spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to destroy Hyrax::AdministrativeSet: 01f04585-9cdb-419e-b5ea-e1c29df3aa57 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to edit Hyrax::AdministrativeSet: 6cf518e1-7fe5-4631-afa3-0acb064ed760 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to update Hyrax::AdministrativeSet: 7d463715-f6af-4780-ab9d-b3e5720f2040 … ``` ``` spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 6989ddd2-1c35-4c4e-913b-b1c496de9a16 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: c65a8e4e-5602-4b40-a380-e1a29f27b8d6 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: b47886ec-7de2-4ff9-a941-72550ed035d8 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to create # spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to destroy Hyrax::AdministrativeSet: acd0222a-02c9-425c-a47f-bf264e1e82ee spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to edit Hyrax::AdministrativeSet: bcf18d6b-5377-4c2a-8dcd-a289a12dd6b2 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates as admin behaves like A user with additional access is expected to be able to update Hyrax::AdministrativeSet: fae65e91-1c11-408f-8210-47420db4cc7b … ```

:recycle: This comment has been updated with latest results.

laritakr commented 1 month ago

@dlpierce I believe I've addressed your feedback requests. Everything passed except that flaky 'email' test.