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

Flexible views #6859

Closed laritakr closed 1 week ago

laritakr commented 1 week ago

Refs

Summary

Building on prior work to dynamically render attributes for the simple schema, this implements a very basic view of attributes on a resource's show view for flexible schemas. More detail is needed in the sample m3 profile to fill in other options (such as render_as and locale details)

I currently have it set up to use the most recent schema for view definition, since we don't want to have to edit, save, and index every work if we change something regarding views.

As long as a term has a basic view: definition section in the schema, it will render from the attributes partial:

# sample view definition:
    view:
      label:
        en: 'Alternative Title'
        es: 'Título Alternativo'
      html_dl: true
Screenshots ![Screenshot 2024-06-28 at 1 52 50 PM](https://github.com/samvera/hyrax/assets/17851674/f4b65b07-9074-4745-ab18-4c61c4cce948) ![Screenshot 2024-06-28 at 1 53 18 PM](https://github.com/samvera/hyrax/assets/17851674/0a508e96-359f-48bc-a730-fc21038d38ce)
github-actions[bot] commented 1 week ago

Test Results

    17 files  ± 0      17 suites  ±0   2h 7m 38s :stopwatch: - 11m 53s  6 716 tests +12   6 147 :white_check_mark:  - 259  297 :zzz: ±0  272 :x: +271  13 241 runs  +66  12 348 :white_check_mark:  - 431  395 :zzz: ±0  498 :x: +497 

For more details on these failures, see this check.

Results for commit 552d5648. ± Comparison against base commit 52af985f.

This pull request removes 291 and adds 303 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 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 AdminSet: 4a8c8ac7-ff85-4afd-81a1-8a5c47c94249 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 1946627f-8fdb-4dd7-93dc-cb7dff3176f4 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 9ea91db6-37b3-488f-8659-94e064100920 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 16a18629-53fa-413e-9ca7-4ff9a8dd64f7 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: a555b3ee-d4c3-4f79-b2ed-7afc9c518953 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: d214f880-a833-48ca-9005-99a1a070cf9d … ``` ``` 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 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 AdminSet: a004e34a-3e00-440e-b9b6-da6347840a9d spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: a38d85c2-b11d-4166-8214-5d9dec8a83c1 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 84132936-a0fc-41c6-99b2-5db960f6d991 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 2caad58f-a6b3-4c50-a611-55d8a17f9e6a spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: d71d7b2d-1655-46d9-bae0-7d19ccd6d6a0 spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: e95c8721-cf09-48de-9c05-7b02bbe1408e … ```