human-essentials
human-essentials copied to clipboard
Allow a hard limit on number of specific items per request
Resolves #5269
Description
- Adds
request_limittoItemUnitandunit_request_limittoItemfields to models - Adds these request limit options for units in the bank's item edit page including for custom units
- Request limit form fields will be disabled if the unit is disabled
- Adds validation to the partners/request page if amount requested is higher than the request limit and will display flash error: "[Item name]: You requested [amount requested] [units if applicable], but are limited to [request limit] [units if applicable].
- Removed ambiguous error message on partners/request page
- Removed some duplicate error messages for the same thing on the partner/request page so it wouldn't much up the flash message
Type of change
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
How Has This Been Tested?
- unit tests for adding an item with request units and request limits
- feature tests that test what displays in the error message on the request page if request quantity exceeds the limit
Screenshots
items/:id/edit page
/partners/requests page
removed this error message from /partners/requests page