HHS / simpler-grants-pdf-builder

PDF builder that's used by the SimplerNOFOs project, part of the Simpler Grants initiative at HHS.
4 stars 1 forks source link

HRSA updates #15

Closed pcraig3 closed 2 weeks ago

pcraig3 commented 2 weeks ago

Summary

This PR does 4 things:

1. Subagency on the cover page

Betty opened a ticket asking for the subagency to be used on the cover page, not the subagency 2. This sounds reasonable to me, so let's ship it.

NOFO data before after
Agency, subagency, and subagency 2 for this NOFO Before: Subagency 2 is used After: Subagency 1 is used
Screenshot 2024-10-25 at 10 16 25 AM Screenshot 2024-10-25 at 10 19 17 AM Screenshot 2024-10-25 at 10 16 51 AM

2. Match more numbered sublist patterns for application table

Sometimes application tables have 'numbered sublists', typically a list of forms. I was using a pattern matching logic to assume when sublists existed and extra indent them. However, it didn't handle numbered ranges.

I've updated the logic to handle all these cases:

before after
Ranges of numbers are not indented Ranges of numbers are indented
Screenshot 2024-10-25 at 10 19 48 AM Screenshot 2024-10-25 at 11 38 02 AM

Note that there is no border under "Attachments"

3. Small change to re-import logic for cover images

As a 'helpful feature', I added some logic where if you import or reimport a NOFO whose opportunity number matches an image filename, the image will be automatically assigned to the NOFO. This is helpful in principle, as if a NOFO is re-imported, the image will show up.

However, if another image is selected, reimporting could potentially overwrite the first image, which isn't something that we want to happen. So now we will only add an image if: