-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
4294 Disable deleting purchases and donations with inactive items #4302
4294 Disable deleting purchases and donations with inactive items #4302
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nitpick, otherwise looks good!
app/views/donations/show.html.erb
Outdated
<%= delete_button_to donation_path(@donation), { | ||
size: "md", | ||
enabled: !@donation.has_inactive_item?, | ||
confirm: "Are you sure you want to permanently remove this donation?" } if current_user.has_role?(Role::ORG_ADMIN, current_organization) %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty hefty statement now - can we break the if
into the block format instead of it being at the end of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorner Thanks for the suggestion. The change has been made.
… into block format for donations and purchases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pshong79 -- Please also change the text in the message to include deletion, as described in the issue.
@cielf 🤦 Sorry! I missed that! It should be corrected now. |
Looks good to me -- @dorner -- if you're happy with the correction to the nitpick, we can merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@pshong79: Your PR |
Resolves #4294
Description
If a donation or a purchase contains an inactive item, the system is likely to return an error.
Currently, when trying to delete a purchase with inactive items in Production, it is returning an inventory error.
To mitigate this, we should just not allow for deleting a purchase or donation if there are inactive items and display a message instructing the user to make the inactive item active.
Type of change
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Tested manually
Updated
donations_request_spec.rb
andpurchases_request_spec.rb
to verify that theDelete
button isdisabled
for theorganization admin
user.Screenshots
Purchases
Before:
After:
Donations
Before:
After: