From d3305aaa763e21878ce3655cfbd55b8a4a5c2628 Mon Sep 17 00:00:00 2001 From: Luke E Glasscock Date: Fri, 30 Apr 2021 16:10:37 -0600 Subject: [PATCH 1/3] Add initial changes for Google Doc removal --- src/components/ContactForm.js | 38 ++++++++++++++++-------------- src/components/FeedbackForm.js | 43 +++++++++++++++++++++++----------- 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/src/components/ContactForm.js b/src/components/ContactForm.js index f075059..70c32dd 100644 --- a/src/components/ContactForm.js +++ b/src/components/ContactForm.js @@ -29,25 +29,27 @@ const ContactForm = ({ onClose, defaultService, ...rest }) => { setServices(defaultService); }, [defaultService]); - const handleSubmit = (event) => { - const data = new FormData(); - data.set('entry.1114584563', name); - data.set('emailAddress', email); - data.set('entry.533506743', services); - data.set('entry.297731592', comments); + const handleSubmit = () => { + 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/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/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); - }); + /* Removing google docs submit */ + + // setSubmitting(true); + // fetch( + // 'https://docs.google.com/forms/d/e/1FAIpQLScsfrAHD8yKJGKF-yI_T9676FR-LDmmuBG_m8uY2TmP_zmZUg/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 ( diff --git a/src/components/FeedbackForm.js b/src/components/FeedbackForm.js index f57deed..423205d 100644 --- a/src/components/FeedbackForm.js +++ b/src/components/FeedbackForm.js @@ -18,23 +18,38 @@ import { PrimaryButton, SecondaryButton } from './core'; const korolevFont = 'korolev, Helvetica Neue, Helvetica, Arial, sans-serif'; 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 [submitting, setSubmitting] = useState(); const [success, setSuccess] = useState(); - const handleSubmit = (event) => { - const data = new FormData(event.target); - 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); - }); + const handleSubmit = () => { + /* + TODO: Jovany, will need to modify the body of the email to send input values + */ + + window.open( + `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Feedback Form&body=`, + '_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 ( -- GitLab From a5dc032ebfbdb53f461ff1dce3adcc2ff6af344d Mon Sep 17 00:00:00 2001 From: "Jovany.Espinoza" Date: Tue, 4 May 2021 15:03:44 -0500 Subject: [PATCH 2/3] Bull-737 --- src/components/FeedbackForm.js | 36 +++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/src/components/FeedbackForm.js b/src/components/FeedbackForm.js index 423205d..0a40899 100644 --- a/src/components/FeedbackForm.js +++ b/src/components/FeedbackForm.js @@ -24,20 +24,35 @@ const FeedbackForm = ({ onClose }) => { ...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 [success, setSuccess] = useState(); const handleSubmit = () => { - /* - TODO: Jovany, will need to modify the body of the email to send input values - */ + /* + TODO: Jovany, will need to modify the body of the email to send input values + */ + + window.open( + `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}%0d%0a%0d%0a`, + '_blank', + 'width=800,height=500' + ); + + + /* window.open( - `mailto:AFLCMC.HN.DT3@us.af.mil?subject=Feedback Form&body=`, + `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', @@ -97,6 +112,9 @@ const FeedbackForm = ({ onClose }) => { id="text-input-comments" name="entry.675672969" style={{ height: '100px' }} + value={thoughts} + onChange={(e) => setThoughts(e.target.value)} + /> { setVolunteer(e.target.checked)} label={ @@ -134,7 +153,8 @@ const FeedbackForm = ({ onClose }) => { } > - + setName(e.target.value)} /> { } > - + setEmail(e.target.value)} /> + -- GitLab From 7a8eb4f3ab78880f0b11fc5c4573847358c40d11 Mon Sep 17 00:00:00 2001 From: "Jovany.Espinoza" Date: Tue, 4 May 2021 15:15:53 -0500 Subject: [PATCH 3/3] Bull-737 --- src/components/FeedbackForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FeedbackForm.js b/src/components/FeedbackForm.js index 0a40899..c8a60c7 100644 --- a/src/components/FeedbackForm.js +++ b/src/components/FeedbackForm.js @@ -37,7 +37,7 @@ const FeedbackForm = ({ onClose }) => { */ window.open( - `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}%0d%0a%0d%0a`, + `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`, '_blank', 'width=800,height=500' ); -- GitLab