Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible views #6859

Merged
merged 4 commits into from
Jun 28, 2024
Merged

Flexible views #6859

merged 4 commits into from
Jun 28, 2024

Conversation

laritakr
Copy link
Contributor

@laritakr laritakr commented Jun 27, 2024

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:

  • if a label: string is provided, the label will be rendered
  • if a label instead has a list of locales, the label will be rendered using locale logic
  • if there is no label, the term name will be formatted as a label. This is consistent with current behavior, and explicitly filling in the label is needed to prevent the default behavior from rendering the label without being bold.
# 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

Screenshot 2024-06-28 at 1 53 18 PM

@laritakr laritakr changed the base branch from main to flexible_double_combo June 27, 2024 22:15
Copy link

Test Results

    17 files  ± 0      17 suites  ±0   2h 7m 38s ⏱️ - 11m 53s
 6 716 tests +12   6 147 ✅  - 259  297 💤 ±0  272 ❌ +271 
13 241 runs  +66  12 348 ✅  - 431  395 💤 ±0  498 ❌ +497 

For more details on these failures, see this check.

Results for commit 552d564. ± Comparison against base commit 52af985.

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 #<Hyrax::PermissionTemplate:0x00007f6730cecd10>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f884b4ff288>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f6730c64758>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f884c39bf58>
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 #<Hyrax::PermissionTemplate:0x00007f812a1443a0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f861597dea0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f812a1c9618>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f86157c5658>
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
…

@laritakr laritakr marked this pull request as ready for review June 28, 2024 18:04
@laritakr laritakr changed the title WIP - Flexible views Flexible views Jun 28, 2024
Add view details.
Try to standardize all 3, with only necessary differences.
@laritakr laritakr merged commit cdd3d7b into flexible_double_combo Jun 28, 2024
@laritakr laritakr deleted the flexible-views branch June 28, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants