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

Fixes the Single Use Link delete button. #6990

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bwatson78
Copy link
Contributor

Summary

Fixes the link by forcing the method to be DELETE (it was defaulting to GET, causing a routing error), allowing it to perform without expecting a redirect (the #destroy controller action has no directive for redirect, just a head :ok response), and a onclick alert response because clicking Delete produces no affirmation to the user.

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

  • Create a Single-Use Link on a FileSet's show page.
  • Refresh the page, and then click the pull-down of Single-Use Links.
  • Click the Delete button of the Link instance.
  • After clicking, an alert window should appear announcing that the request was sent.
  • Refresh the page and the link shouldn't appear in the pull-down anymore.

Type of change (for release notes)

  • notes-bugfix Bug Fixes

Changes proposed in this pull request:

  • adds remote=true to link.
  • adds method="DELETE" to link.
  • affirms user that request was sent after clicking.

@samvera/hyrax-code-reviewers

Copy link

github-actions bot commented Jan 22, 2025

Test Results

    13 files  ±0      13 suites  ±0   2h 46m 7s ⏱️ - 5m 8s
 6 832 tests ±0   6 530 ✅  - 3  299 💤 ±0  3 ❌ +3 
18 101 runs  ±0  17 621 ✅  - 3  477 💤 ±0  3 ❌ +3 

For more details on these failures, see this check.

Results for commit e06b8da. ± Comparison against base commit 5b03f59.

This pull request removes 366 and adds 366 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:0x00007f1dee2c75a0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fd7baffec60>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fed1e19c6d0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f1decb548a0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fd7b396f3d8>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fed21bcaa00>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 0a7a0ecf-5a43-4cb0-ad08-cb47adfcb322
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 08d73801-d28a-49d0-8c4f-ee4604573baa
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 0ed58e92-069e-4b1e-806e-d7df3162ea01
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: 63f2d00f-1e8b-4cfe-854d-e6fcb00b7047
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f5983362d18>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f9688f2b040>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fddc1417e58>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f59832ce398>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f9688c3ce60>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fddc179f508>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: ec1d4940-da81-4dd6-a7a5-7c65c9235b62
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 96104acc-f1b1-4357-83f1-52cd254270d2
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: bbb70e10-2150-4fb6-89c1-1a60ad991929
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to edit AdminSet: e378965f-6dc0-4f8b-b2fe-550d2b25826f
…

♻️ This comment has been updated with latest results.

@dlpierce
Copy link
Member

I cannot replicate the problem on either dev or pg nurax. I'm seeing a DELETE request and 200 response in the browser's network log.

@bwatson78 bwatson78 force-pushed the fixes_single_use_link_delete_bug branch from 9a023dc to e06b8da Compare February 7, 2025 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants