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

Submission for device donations #161

Merged
merged 11 commits into from
Sep 7, 2021
Merged

Conversation

pydanny
Copy link
Collaborator

@pydanny pydanny commented Sep 6, 2021

This satisfies the requirements for #135.

  • Added firebase config for instantiating firebase admin object
  • Added API function for processing the form
  • Update .env.example
  • Document how to get secret keys out of Firebase. We'll expand on it in Document how to set up firebase for form submissions #165.
  • Add formHandler to give-device.js form

Email of receipts will be submitted in #166.

- Added firebase config for instantiating firebase admin object
- Added API function for processing the form
@vercel
Copy link

vercel bot commented Sep 6, 2021

Deployment failed with the following error:

The most recent charge for your active payment method has failed. Please update it here: https://vercel.com/teams/margaritahumanitarian/settings/billing.

@pydanny pydanny marked this pull request as draft September 6, 2021 02:43
@pydanny pydanny changed the title WIP: First pass at working function, albeit only with GET requests WIP: First pass at working submission for device donations Sep 6, 2021
Daniel Roy Greenfeld added 5 commits September 5, 2021 20:04
- Remove default values
- Add router redirect
- Switch to ISO 3166 country codes
- Simple validation
- Add divider for non-esstential fields
- Add firebase keys to .env.example
- Match variable names between files
@pydanny pydanny changed the title WIP: First pass at working submission for device donations WIP: Submission for device donations Sep 6, 2021
@pydanny pydanny marked this pull request as ready for review September 6, 2021 15:40
@pydanny pydanny changed the title WIP: Submission for device donations Submission for device donations Sep 6, 2021
@vercel
Copy link

vercel bot commented Sep 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/margaritahumanitarian/helpafamily/juERVBp8LNKHj5zF7nToD3GsZkwD
✅ Preview: https://helpafamily-git-add-device-donatio-f90069-margaritahumanitarian.vercel.app

Copy link
Member

@audreyfeldroy audreyfeldroy left a comment

Choose a reason for hiding this comment

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

Thanks for implementing the form backend! This is good to merge.

@@ -33,7 +33,7 @@ SelectFormControl.propTypes = {
label: PropTypes.string,
options: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
Copy link
Member

Choose a reason for hiding this comment

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

I just got an explanation from @pydanny about this. He says value is option-specific whereas id is for the whole select component.

{ value: 'LV', label: 'Latvia' },
{ value: 'IN', label: 'India' },
{ value: 'BD', label: 'Bangladesh' },
{ value: 'PH', label: 'Philippines' },
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I like the ISO 3166-1 Alpha-2 codes here.

const [valueOfDevice, setValueOfDevice] = React.useState('');
const [about, setAbout] = React.useState('');
const [phone, setPhone] = React.useState('');
const [originalPurchasePrice, setOriginalPurchasePrice] = React.useState('');
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for changing valueOfDevice to originalPurchasePrice. This helps us follow best practices for donation valuation for better tax compliance.

<InputFormControl
id="name"
label="Name"
label="Name *"
Copy link
Member

Choose a reason for hiding this comment

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

We'll want to replace the manually-coded * markings with required attributes later, but this is okay for now. We'll iterate.

@audreyfeldroy
Copy link
Member

I submitted the form and it worked, great!

@audreyfeldroy audreyfeldroy merged commit a904daa into main Sep 7, 2021
@RedFox0x20 RedFox0x20 deleted the add-device-donation-function branch September 17, 2021 20:06
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