rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
436 stars 450 forks source link

4437 preserve kit form fields upon error #4452

Closed PhilipDeFraties closed 1 week ago

PhilipDeFraties commented 2 weeks ago

Resolves #4437

Description

Updates KitsController#create to so that submitted form field data is re-populated in page re-render upon creation error

Type of change

How Has This Been Tested?

sign in as org_admin1@example.com Inventory | Kits click "New Kit" without specifying a name, specify an item in the kit ("Choose an Item" and fill in Quantity) Click Save

You will get an error but the item and quantity you have specified will be present in their respective fields. (as per issue repro steps)

Also added feature test to existing system specs concerning kit creation

github-actions[bot] commented 5 days ago

@PhilipDeFraties: Your PR 4437 preserve kit form fields upon error is part of today's Human Essentials production release: 2024.06.23. Thank you very much for your contribution!