UNCLASSIFIED

Commit 9ed74130 authored by Jovany Espinoza's avatar Jovany Espinoza
Browse files

Merge branch 'Bull-737' into 'staging'

Bull 737

See merge request !31
parents 4d5d008a 7a8eb4f3
Pipeline #245510 passed with stages
in 6 minutes and 28 seconds
...@@ -29,25 +29,27 @@ const ContactForm = ({ onClose, defaultService, ...rest }) => { ...@@ -29,25 +29,27 @@ const ContactForm = ({ onClose, defaultService, ...rest }) => {
setServices(defaultService); setServices(defaultService);
}, [defaultService]); }, [defaultService]);
const handleSubmit = (event) => { const handleSubmit = () => {
const data = new FormData(); window.open(
data.set('entry.1114584563', name); `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Contact Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail address:%0d%0a${email}%0d%0a%0d%0aServices or solutions you are interested in:%0d%0a${services}%0d%0a%0d%0aComments or details:%0d%0a${comments}%0d%0a%0d%0a`,
data.set('emailAddress', email); '_blank',
data.set('entry.533506743', services); 'width=800,height=500'
data.set('entry.297731592', comments); );
setSubmitting(true); /* Removing google docs submit */
fetch(
'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/formResponse', // setSubmitting(true);
{ // fetch(
mode: 'no-cors', // we don't care about the result of this request, so just do it. // 'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/formResponse',
method: 'POST', // {
body: data, // mode: 'no-cors', // we don't care about the result of this request, so just do it.
} // method: 'POST',
).then((res) => { // body: data,
setSubmitting(false); // }
setSuccess(true); // ).then((res) => {
}); // setSubmitting(false);
// setSuccess(true);
// });
}; };
return ( return (
......
...@@ -18,23 +18,53 @@ import { PrimaryButton, SecondaryButton } from './core'; ...@@ -18,23 +18,53 @@ import { PrimaryButton, SecondaryButton } from './core';
const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif'; const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif';
const FeedbackForm = ({ onClose }) => { const FeedbackForm = ({ onClose }) => {
/*
TODO: Jovany, will need to add initial state for form inputs here
...will also need to add onChange methods in the render section, similar to ContactForm.js
*/
const [name, setName] = useState('');
const [email, setEmail] = useState('');
const [thoughts, setThoughts] = useState('');
const [volunteer, setVolunteer] = useState(false);
const [submitting, setSubmitting] = useState(); const [submitting, setSubmitting] = useState();
const [success, setSuccess] = useState(); const [success, setSuccess] = useState();
const handleSubmit = (event) => { const handleSubmit = () => {
const data = new FormData(event.target); /*
setSubmitting(true); TODO: Jovany, will need to modify the body of the email to send input values
fetch( */
'https://docs.google.com/forms/d/e/1FAIpQLSf79Q_Cl2MC9wxUHUEZWvUAAehxUaGn_wKmJ014E49-ENaS3Q/formResponse',
{ window.open(
mode: 'no-cors', // we don't care about the result of this request, so just do it. `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Feedback Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail:%0d%0a${email}%0d%0a%0d%0aThoughts:%0d%0a${thoughts}%0d%0a%0d%0aVolunteer:%0d%0a${volunteer === true ? 'Yes' : 'No'}%0d%0a%0d%0a`,
method: 'POST', '_blank',
body: data, 'width=800,height=500'
} );
).then((res) => {
setSubmitting(false);
setSuccess(true); /*
});
window.open(
`mailto:AFLCMC.HN.DT3@us.af.mil?subject=Contact Form&body=Name:%0d%0a${name}%0d%0a%0d%0aEmail address:%0d%0a${email}%0d%0a%0d%0aServices or solutions you are interested in:%0d%0a${services}%0d%0a%0d%0aComments or details:%0d%0a${comments}%0d%0a%0d%0a`,
'_blank',
'width=800,height=500'
);
*/
// setSubmitting(true);
// fetch(
// 'https://docs.google.com/forms/d/e/1FAIpQLSf79Q_Cl2MC9wxUHUEZWvUAAehxUaGn_wKmJ014E49-ENaS3Q/formResponse',
// {
// mode: 'no-cors', // we don't care about the result of this request, so just do it.
// method: 'POST',
// body: data,
// }
// ).then((res) => {
// setSubmitting(false);
// setSuccess(true);
// });
}; };
return ( return (
...@@ -82,6 +112,9 @@ const FeedbackForm = ({ onClose }) => { ...@@ -82,6 +112,9 @@ const FeedbackForm = ({ onClose }) => {
id="text-input-comments" id="text-input-comments"
name="entry.675672969" name="entry.675672969"
style={{ height: '100px' }} style={{ height: '100px' }}
value={thoughts}
onChange={(e) => setThoughts(e.target.value)}
/> />
</FormField> </FormField>
<ThemeContext.Extend <ThemeContext.Extend
...@@ -91,7 +124,8 @@ const FeedbackForm = ({ onClose }) => { ...@@ -91,7 +124,8 @@ const FeedbackForm = ({ onClose }) => {
<CheckBox <CheckBox
id="checkbox-panel" id="checkbox-panel"
name="entry.619303959" name="entry.619303959"
value="volunteer" checked={volunteer}
onChange={(e) => setVolunteer(e.target.checked)}
label={ label={
<Box> <Box>
<Text weight="bold" size="small"> <Text weight="bold" size="small">
...@@ -119,7 +153,8 @@ const FeedbackForm = ({ onClose }) => { ...@@ -119,7 +153,8 @@ const FeedbackForm = ({ onClose }) => {
</Text> </Text>
} }
> >
<TextInput id="text-input-name" name="entry.1573591932" /> <TextInput id="text-input-name" name="entry.1573591932" value={name}
onChange={(e) => setName(e.target.value)} />
</FormField> </FormField>
<FormField <FormField
name="entry.18763422251876342225" name="entry.18763422251876342225"
...@@ -133,7 +168,9 @@ const FeedbackForm = ({ onClose }) => { ...@@ -133,7 +168,9 @@ const FeedbackForm = ({ onClose }) => {
</Text> </Text>
} }
> >
<TextInput id="text-input-email" name="entry.1876342225" /> <TextInput id="text-input-email" name="entry.1876342225" value={email}
onChange={(e) => setEmail(e.target.value)} />
</FormField> </FormField>
<Box pad={{ top: 'medium' }} align="center" justify="center"> <Box pad={{ top: 'medium' }} align="center" justify="center">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment