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

feat: add country selection to address component 🇨🇦 #434

Merged
merged 9 commits into from
Aug 22, 2024

Conversation

jessherlitz
Copy link
Contributor

@jessherlitz jessherlitz commented Aug 5, 2024

Description ✏️

Closes #342

  • Modified the address component to handle country selection from either 'US' or 'CA'.
  • Added CA_PROVINCES constant to address component using official abbreviations for provinces.
  • Updated the address component to dynamically display values from USA_STATES or CA_PROVINCES depending on the selected country.
  • Updated Swag Pack form to have a field for selecting country and to render states or provinces depending on what is selected for countries.
  • Added addressCountry field to student database table.
  • Updated [claimSwagPack] and [orderSwagPack] to pass in country.

Type of Change 🐞

  • Feature - A non-breaking change which adds functionality.
  • Fix - A non-breaking change which fixes an issue.
  • Refactor - A change that neither fixes a bug nor adds a feature.
  • Documentation - A change only to in-code or markdown documentation.
  • Tests - A change that adds missing unit/integration tests.
  • Chore - A change that is likely none of the above.

Checklist ✅

  • I have done a self-review of my code.
  • I have manually tested my code (if applicable).
  • I have added/updated any relevant documentation (if applicable).

@jessherlitz
Copy link
Contributor Author

jessherlitz commented Aug 5, 2024

hi @tomas-salgado! I just wanted to give an update on what I've been working on. Let me know if I am heading in the right direction. Thank you!

@tomas-salgado
Copy link
Collaborator

@jessherlitz yep, this looks like it's on the right track! It seems the CI test is failing right now because of a types issue, but at first glance it doesn't look like it should be too tricky to resolve. Let me know if you need any help!

@jessherlitz
Copy link
Contributor Author

@tomas-salgado sorry for the delay on this.. I am almost done!!

@jessherlitz jessherlitz marked this pull request as ready for review August 17, 2024 19:08
@jessherlitz jessherlitz changed the title wip - modified the address component to handle country selection modified the address component to handle country selection and added column "address_country" in database Aug 17, 2024
@jessherlitz
Copy link
Contributor Author

Hi @tomas-salgado! I finished this issue. Could you please review it? Thank you!

Copy link
Collaborator

@tomas-salgado tomas-salgado left a comment

Choose a reason for hiding this comment

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

Nice work @jessherlitz! Left a few comments-lmk when those are addressed and I'll take another look!

packages/ui/src/components/address.tsx Outdated Show resolved Hide resolved
packages/ui/src/components/address.tsx Outdated Show resolved Hide resolved
packages/ui/src/components/address.tsx Outdated Show resolved Hide resolved
@jessherlitz jessherlitz changed the title modified the address component to handle country selection and added column "address_country" in database feat: modified the address component to handle country selection and added column "address_country" in database Aug 19, 2024
@tomas-salgado tomas-salgado changed the title feat: modified the address component to handle country selection and added column "address_country" in database feat: added country selection to address component 🇨🇦 Aug 21, 2024
Copy link
Collaborator

@tomas-salgado tomas-salgado left a comment

Choose a reason for hiding this comment

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

Just tested this out locally, really great work @jessherlitz!

One note for @ramiAbdou when he reviews:
Right now the dropdown for states will default to US States, but it changes to Canadian territories if you select your country as Canada. This functionality works fine. Do you think this is good or we should have the remaining fields (State, etc.) only appear AFTER selecting country?

@tomas-salgado tomas-salgado added the Ready for Rami ✅ This PR is ready for a final review label Aug 22, 2024
@ramiAbdou
Copy link
Member

One note for @ramiAbdou when he reviews: Right now the dropdown for states will default to US States, but it changes to Canadian territories if you select your country as Canada. This functionality works fine. Do you think this is good or we should have the remaining fields (State, etc.) only appear AFTER selecting country?

I took a look at other address fields (ie: Stripe) and they typically have the country field appear first, so I moved the country field to the top, so I think that should suffice. Don't think we need to hide the other fields or anything like that since most people will fill out the form in order.

Copy link
Member

@ramiAbdou ramiAbdou left a comment

Choose a reason for hiding this comment

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

Back-to-back amazing PRs @jessherlitz! 🔥

A bit of unfortunate news that we just found out today though...so apparently SwagUp supports international shipments now, however there's specific items that can't be shipped internationally and we have one of those items in our swag pack 😞😞

That being said, this PR is still helpful b/c now we know if a member is trying to ship to Canada. I added some logic to notify our team if someone tries to claim their pack using a Canadian address so that we can manually send them a merch store gift card).

Keep up the momentum, Jess!

@ramiAbdou ramiAbdou changed the title feat: added country selection to address component 🇨🇦 feat: add country selection to address component 🇨🇦 Aug 22, 2024
@ramiAbdou ramiAbdou merged commit b7b416c into colorstackorg:main Aug 22, 2024
1 check passed
@jessherlitz jessherlitz deleted the ticket-342 branch August 22, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Rami ✅ This PR is ready for a final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Canadian addresses for swag pack 🇨🇦
3 participants