-
-
Notifications
You must be signed in to change notification settings - Fork 572
Enable csv import of partners with six fields #5171
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
Open
McEileen
wants to merge
16
commits into
rubyforgood:main
Choose a base branch
from
McEileen:em/5056-import-partners
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
db6eebb
enable csv import of partners with six fields
McEileen 955d07d
improve resilience of csv import of partners
McEileen 3dfc64e
enable importable concern to display flash errors or flash alerts
McEileen 08f85c0
make warnings display as errors when partner import hits both errors …
McEileen 5844569
Refactor warnings to be part of the mixin
jonny5 eb5c111
Fix error display
jonny5 e91044b
Fix warning text
jonny5 df08d79
Merge branch 'main' into em/5056-import-partners
jonny5 42824d4
Remove skip blanks for consistency
jonny5 ce673f5
Merge branch 'main' into em/5056-import-partners
awwaiid 0bf6c93
Merge branch 'main' into em/5056-import-partners
awwaiid 6dbf828
Merge remote-tracking branch 'upstream/main' into em/5056-import-part…
jonny5 023a1a4
Add specs
jonny5 1407358
Merge remote-tracking branch 'upstream/main' into em/5056-import-part…
jonny5 11eae3d
Cleanup
jonny5 1b52576
Merge branch 'main' into em/5056-import-partners
jonny5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 1,partner1@example.com,"Smithsonian Conservation Center",false,20,"test note 1" | ||
| Partner 2,partner2@example.com,"Smithsonian Conservation Center",false,30,"test note 2" | ||
| Partner 3,partner3@example.com,"Smithsonian Conservation Center",true,10,"test note 3" |
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
spec/fixtures/files/partners_missing_default_storage_location_field.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 51,partner51@example.com,,false,50,"great partner" | ||
|
|
2 changes: 2 additions & 0 deletions
2
spec/fixtures/files/partners_missing_default_storage_location_field_and_header.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| name,email,send_reminders,quota,notes | ||
| Partner 71,partner71@example.com,false,50,"great partner" |
3 changes: 3 additions & 0 deletions
3
spec/fixtures/files/partners_missing_send_reminders_field.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 51,partner51@example.com,"Smithsonian Conservation Center",,50,"great partner" | ||
|
|
3 changes: 3 additions & 0 deletions
3
spec/fixtures/files/partners_missing_send_reminders_field_and_header.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| name,email,default_storage_location,quota,notes | ||
| Partner 51,partner51@example.com,"Smithsonian Conservation Center",50,"great partner" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,21 @@ | ||
| name,email | ||
| Beaverton Police Department,krodriguez@beavertonoregon.gov | ||
| Catholic Charities,lcrombie@catholiccharitiesoregon.org | ||
| Clackamas Service Center,debramason@cscoregon.org | ||
| Healthy Familes of Clackamas County,bkersens@healthyfamiliescc.org | ||
| Dollar for Portland,jared@dollorfor.org | ||
| Emmanuel Housing Center,shauntemeyers@emmanuelpdx.org | ||
| Helensview School,hgandee@mesd.k12.or.us | ||
| JOIN,ccarroll@joinpdx.org | ||
| Job Corps (PIVOT),zutz.kayla@jobcorps.org | ||
| NARA,christman@naranw.org | ||
| NW Housing Alternatives,doty@nwhousing.org | ||
| Pregnancy Resource Center,debbie@portlandprc.org | ||
| Portland Homeless Family Solutions,emma@pdxhfs.org | ||
| Raphael House,lvold@raphaelhouse.com | ||
| The Rebecca Foundation's Cloth Diaper Closet,portland@clothforall.org | ||
| Rose Haven,adeol@rosehaven.org | ||
| Self Enhancement Inc.,stephaniep@selfenhancement.org | ||
| Teen Parent Services (PPS),lgovan@pps.net | ||
| Volunteers of America,cross@voaor.org | ||
| Central City Concern,lindsey.ramsey@ccconcern.org | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Beaverton Police Department,krodriguez@beavertonoregon.gov,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Catholic Charities,lcrombie@catholiccharitiesoregon.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Clackamas Service Center,debramason@cscoregon.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Healthy Familes of Clackamas County,bkersens@healthyfamiliescc.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Dollar for Portland,jared@dollorfor.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Emmanuel Housing Center,shauntemeyers@emmanuelpdx.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Helensview School,hgandee@mesd.k12.or.us,"Smithsonian Conservation Center",true,50,"great partner" | ||
| JOIN,ccarroll@joinpdx.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Job Corps (PIVOT),zutz.kayla@jobcorps.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| NARA,christman@naranw.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| NW Housing Alternatives,doty@nwhousing.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Pregnancy Resource Center,debbie@portlandprc.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Portland Homeless Family Solutions,emma@pdxhfs.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Raphael House,lvold@raphaelhouse.com,"Smithsonian Conservation Center",true,50,"great partner" | ||
| The Rebecca Foundation's Cloth Diaper Closet,portland@clothforall.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Rose Haven,adeol@rosehaven.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Self Enhancement Inc.,stephaniep@selfenhancement.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Teen Parent Services (PPS),lgovan@pps.net,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Volunteers of America,cross@voaor.org,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Central City Concern,lindsey.ramsey@ccconcern.org,"Smithsonian Conservation Center",true,50,"great partner" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 31,partner31@example.com,"Smithsonian Conservation Center",true,50,"great partner" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 1,partner1@example.com,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Partner 2,partner2@example.com,"Smithsonian Conservation Center",true,75,"such a great partner" | ||
| Partner 4,partner4@example.com,"Smithsonian Conservation Center",false,80,"really ten out of ten" |
4 changes: 4 additions & 0 deletions
4
spec/fixtures/files/partners_with_six_fields_and_duplicates.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 1,partner1@example.com,"Smithsonian Conservation Center",true,50,"great partner" | ||
| Partner 2,partner2@example.com,"Smithsonian Conservation Center",true,75,"such a great partner" | ||
| Partner 3,partner3@example.com,"Smithsonian Conservation Center",true,80,"yay, a partner" |
4 changes: 4 additions & 0 deletions
4
spec/fixtures/files/partners_with_six_fields_capitalized_location.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 1,partner1@example.com,"SMITHSONIAN CONSERVATION CENTER",true,50,"great partner" | ||
| Partner 2,partner2@example.com,"Smithsonian Conservation Center",true,75,"such a great partner" | ||
| Partner 4,partner4@example.com,"Smithsonian Conservation Center",false,80,"really ten out of ten" |
2 changes: 2 additions & 0 deletions
2
spec/fixtures/files/partners_with_six_fields_invalid_location.csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| name,email,default_storage_location,send_reminders,quota,notes | ||
| Partner 4,partner4@example.com,"Invalid",false,80,"really ten out of ten" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistence, do we actually want to add
skip_blanks: truewhen we have a number of other places where we parse CSV data where we don't? It's easier to explain a rule on import to users that's true in all cases.If we think we should allow+skip blanks on CSV import, can we leave that out here and do it in a separate PR updating every
CSV.parsewe're using?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 consistency is good, I removed that change