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

Let a user upload a recipient spreadsheet in either EN or FR #1676

Merged
merged 7 commits into from
Oct 4, 2023

Conversation

jzbahrai
Copy link
Contributor

@jzbahrai jzbahrai commented Sep 22, 2023

Summary | Résumé

We need to pass a language filter to decide what error message we will show on a CSV file.
After we merge this code users will be able to upload a file with either "email address" or "adresses courriel" in either FR/ EN context. Same for phone numbers.

The best way to test this code is the following:

  1. Check out this branch
  2. Copy paste these files into your ADMIN AND API dev container:
    https://github.com/cds-snc/notification-utils/blob/task/fix-upload/notifications_utils/recipients.py
    https://github.com/cds-snc/notification-utils/blob/task/fix-upload/notifications_utils/columns.py

Here are the use cases I could think of:

I was using success@simulator ..you need to USE an actual email address and ensure the email reaches your inbox.

  • User preference is EN and they send an EMAIL spreadsheet with an EN heading
  • User preference is EN and they send an EMAIL spreadsheet with an FR heading
  • User preference is EN and they send a SMS spreadsheet with an EN heading
  • User preference is EN and they send a SMS spreadsheet with an FR heading
  • User preference is EN , send an email without the correct heading - error message should be the EN heading
  • User preference is EN, send an SMS without the correct heading - error message should be the EN heading
  • User preference is FR and they send an EMAIL spreadsheet with an EN heading
  • User preference is FR and they send an EMAIL spreadsheet with an FR heading
  • User preference is FR and they send a SMS spreadsheet with an EN heading
  • User preference is FR and they send a SMS spreadsheet with an FR heading
  • User preference is FR, send an email without the correct heading - error message should be the FR heading
  • User preference is FR, send an SMS without the correct heading - error message should be the FR heading
  • Send an empty CSV file, you should get an error in the language of your preference
  • Test with placeholders in the template but the file fails - error in lang of your preference
  • Test with placeholders in the template but file doesn't fail
  • Test the sample spreadsheet is generated with the correct headings depending on the context you are in.
    Eg: Screenshot 2023-09-25 at 5 07 00 PM

This PR will fail until we merge: cds-snc/notification-utils#245

@github-actions
Copy link

Copy link
Member

@andrewleith andrewleith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works perfectly, all scenarios pass, everything working as expected.

@jzbahrai jzbahrai changed the title DO NOT MERGE: Set language Let a user upload a recipient spreadsheet in either EN or FR Oct 3, 2023
@jzbahrai jzbahrai merged commit d1829e6 into main Oct 4, 2023
9 checks passed
@jzbahrai jzbahrai deleted the task/fix-task branch October 4, 2023 13:35
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