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

Don't allow deletion of items that are part of a request #4728

Closed
2 tasks
cielf opened this issue Oct 20, 2024 · 4 comments · Fixed by #4734
Closed
2 tasks

Don't allow deletion of items that are part of a request #4728

cielf opened this issue Oct 20, 2024 · 4 comments · Fixed by #4734
Assignees

Comments

@cielf
Copy link
Collaborator

cielf commented Oct 20, 2024

Summary

If you delete an item, any requests using that item are unviewable So you shouldn't be able to delete an item if there are any requests.

Why?

Hygiene. This is unlikely to happen in the wild.

Details

Recreation

Sign in as org_admin1,
Click on Partner Agencies, then All Partners in the left hand menu
Click on Pawnee Parent Service.
Click Edit Partner Information
Set Group to None
Update Partner
Click on Inventory, then Items& Inventory in the left hand menu.
Click on New Item
Fill in some info, make sure Item is Visible to Partners? is checked
Save
Logout
Sign in as [email protected]
Create a request that includes that item
Save and confirm
Login as [email protected]
click on requests -- you will see that request
Click on Inventory | Items & Inventory
click on "Delete" beside the item that you added
Confirm
Click on Requests -- it was still showing the request for me, but that might be caching?
Click on View -- Get a "Still haven't found what you're looking for"

What should happen

  • Don't allow deletion of items that are part of a request
  • there should be no delete button on the item. There should, however, be a deactivate button.

Criteria for completion

  • behaviour as described above
  • tests to support the behaviour
@cielf cielf added Help Wanted Groomed + open to all! Difficulty—Beginner labels Oct 20, 2024
@jorgecoutinhobr
Copy link
Contributor

I would like to work on this issue

@cielf
Copy link
Collaborator Author

cielf commented Oct 20, 2024

Please do!

@github-actions github-actions bot removed the Help Wanted Groomed + open to all! label Oct 20, 2024
@jorgecoutinhobr
Copy link
Contributor

@cielf Should I allow items that are part of a request to not be deleted unless the request status is "discarded"?

@cielf
Copy link
Collaborator Author

cielf commented Oct 23, 2024

@jorgecoutinhobr Hmm - good question -- I think we want to disallow deletion of the item even if the request's status is discarded. They will still be able to deactivate the item in any case. FWIW, this is a real edge case -- we already disallow deletion if there has ever been any inventory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants