Skip to content
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

Fixes for new DGHP document #113

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Fixes for new DGHP document #113

merged 2 commits into from
Dec 12, 2024

Conversation

pcraig3
Copy link
Collaborator

@pcraig3 pcraig3 commented Dec 12, 2024

Summary

This PR adds 2 things: 1 change and 1 bugfix.

  1. Decompose "instructions" boxes for NEW NOFO WRITERS
  2. replace_chars was not being applied — now it is

1. Decompose "instructions" boxes for NEW NOFO WRITERS

Content Guide documents have often have instructions for writers, explaining how to fill out the following section.

Screenshot 2024-12-11 at 7 27 05 PM

Previously, all of these boxes would be titled "Instructions for NOFO writers:", but now we are seeing a variant that goes "Instructions for new NOFO writers". Updated the function to remove these boxes as well.

before after
layout is messed up. "Instructions for new NOFO writers" box should not be there. Certified fresh.
Screenshot 2024-12-11 at 7 30 03 PM Screenshot 2024-12-11 at 7 30 11 PM

2. replace_chars was not being applied — now it is

So when I added the replace_links function (#64), I created a bug in the nofo_import route.

Here's the bug:

# replace problematic characters/links on import
cleaned_content = replace_chars(file_content)
cleaned_content = replace_links(file_content) # bug is here: this function should be taking "cleaned_content"

So the replace_chars function was being run but not saved, which meant that we were seeing weird stuff coming back in, primarily where we see this is around the application checkboxes.

Small fix to get this working again, although it took a while to find.

before after
checkboxes are umlaut character (¨) checkboxes are normal, because replace_chars deals with it
Screenshot 2024-12-11 at 7 36 16 PM Screenshot 2024-12-11 at 7 36 07 PM

These new DGHP NOFOs have slightly different instructions tables
headings.

Here is the comment that is in the document:

> Note - Most instances of “NOFO Writers” has been replaced with “New NOFO Team” as DGHP AMT populates the full Content Guide (NOFO writers/lead authors/OUs fill out the pre-NOFO).

They also don't use colons, so I have removed that as well as
a necessary part of the string match.

Are we playing whack-a-mole with this?

Maybe.

Is it working so far?

Yes.
So when I added the `replace_links` function, I created a bug in the `nofo_import` route.

1a891b4

Here's the bug:

```python
cleaned_content = replace_chars(file_content)
cleaned_content = replace_links(file_content) # bug is here: this function should be taking "cleaned_content"
```

So the `replace_chars` function was being run but not saved, which meant that we were seeing weird stuff coming back in, primarily where we see this is around the application checkboxes.

Small fix to get this working again, although it took a while to find.
@pcraig3 pcraig3 requested a review from admoorgit December 12, 2024 01:50
@admoorgit admoorgit merged commit ba727a8 into main Dec 12, 2024
4 checks passed
@pcraig3 pcraig3 deleted the fixes-dghp branch December 18, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants