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

ability to skip the logo on save #6903

Merged
merged 6 commits into from
Sep 19, 2024
Merged

Conversation

orangewolf
Copy link
Member

Fixes

Any time the collection is saved via the form, if logo ids are not sent to the form, the logo are cleared from the collection AND the logos are deleted.

Summary

This change makes the default use of the form safer. It does not change the current view save behavior, but makes updating collections via Bulkrax, via alternate controller / forms, via rake tasks, and via the console much safer.

Guidance for testing, such as acceptance criteria or new user interface behaviors:

  • Create a collection via the UI, add a logo and a banner
  • On the console, run the following to update the collection
        res = Hyrax.query_service.find_by(id: COLLECTION_ID)
        # start with a form for the resource
        fm = form_for(model:).constantize.new(resource: res)
        result = Hyrax::Transactions::Container[collection_model_event_mapping[model]].call(fm)
  • See that the logo is still present on the collection when the page is refreshed.

@samvera/hyrax-code-reviewers

@orangewolf orangewolf added the notes-bugfix Release Notes: Fixed a bug label Sep 18, 2024
Copy link

github-actions bot commented Sep 18, 2024

Test Results

    17 files  ±0      17 suites  ±0   2h 17m 15s ⏱️ - 1m 54s
 6 706 tests ±0   6 409 ✅ ±0  297 💤 ±0  0 ❌ ±0 
13 180 runs  ±0  12 785 ✅ ±0  395 💤 ±0  0 ❌ ±0 

Results for commit dfdd316. ± Comparison against base commit 0a14163.

This pull request removes 274 and adds 274 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:0x00007f0eb7e14110>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f55d550ca80>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f0eb74d4898>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f55d78af500>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 2279a8c9-54a8-43ff-b779-65d0c96f5e16
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 84b7b6d1-6291-44f7-a507-b4cc51436eaf
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 3f6c73b5-9482-4515-8339-83194866912a
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: 687ec385-b4b6-4d41-aaa8-e9fef4539319
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 1cefbd53-9642-475c-acb7-00c0bc804964
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: 4ad77f7e-8b8c-4efb-998a-f665d97566c7
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f1195ffbce0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f874a440650>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f1193ac21e0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f874c059b20>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 19195b3f-e63f-4a20-86e0-d4fd9e2c95e8
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 513238d6-9508-404b-9289-0f673e754592
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 2aa9e97b-49da-4499-93fc-9a4014dd2cc0
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit Hyrax::AdministrativeSet: da601299-1cb5-410f-98df-c2fdc0b5cfe4
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update AdminSet: 9e4e3f8e-6dee-411e-970e-1cbfc27034bc
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to update Hyrax::AdministrativeSet: cf829137-b9b3-4e31-9337-a8864e25204e
…

♻️ This comment has been updated with latest results.

aprilrieger
aprilrieger previously approved these changes Sep 19, 2024
@orangewolf orangewolf merged commit e4886f1 into main Sep 19, 2024
22 checks passed
@orangewolf orangewolf deleted the skip_logo_on_collection_save branch September 19, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes-bugfix Release Notes: Fixed a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants