Adding reimbursement status badge#7055
Conversation
| <span class="badge badge-pill light-bg text-black">Draft</span> | ||
| <% end %> | ||
| <% if contact.want_driving_reimbursement? %> | ||
| <% decorated_contact = contact.decorate %> |
There was a problem hiding this comment.
Caching contact.decorate in a local variable here is actually a nice improvement over how the rest of this partial handles it, worth considering decorating once at the top of this partial and reusing it everywhere, rather than just in this new block. From what I see, right now contact.decorate gets called fresh four separate times above this (medium_icon_classes, contact_groups, contact_types, subheading), each one allocating a new decorator instance, and this renders once per case contact on the page, so it adds up across however many rows are showing. Not a blocker, but would be nice for anyone touching this file again, pulling the decoration to the top and reusing your variable throughout would clean up an existing inefficiency.
There was a problem hiding this comment.
Could totally be done in a separate PR dedicated exclusively to improvements, and then testing the corresponding pieces that were touched.
arielsalcepk
left a comment
There was a problem hiding this comment.
Looks great to me! Thanks for adding this one so quickly 👍
What github issue is this PR for, if any?
Addresses #7041
What changed, and why?
Added a ui feature to let volunteers know the current state of reimbursements to reduce emails to supervisors
How is this tested? (please write rspec and jest tests!) 💖💪
Added new unit tests in spec/system/case_contacts/index_spec.rb and spec/decorators/case_contact_decorator_spec.rb to cover the new added content/feature
Screenshots please :)
Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.

