From bcd4000b91cbfce67435e0e979208353001a55f6 Mon Sep 17 00:00:00 2001 From: Liz Baker Date: Wed, 14 Feb 2024 15:10:41 -0800 Subject: [PATCH 01/16] chore: Remove freetext and increase chance to show --- src/components/FeedbackModal/FeedbackModal.js | 82 +------------------ 1 file changed, 3 insertions(+), 79 deletions(-) diff --git a/src/components/FeedbackModal/FeedbackModal.js b/src/components/FeedbackModal/FeedbackModal.js index fca77fa8fcf..dc54b2a3f34 100644 --- a/src/components/FeedbackModal/FeedbackModal.js +++ b/src/components/FeedbackModal/FeedbackModal.js @@ -20,8 +20,8 @@ import { SUPRQ_QUESTIONS } from '../../utils/constants'; const FORM_VERSION = 1; const questions = shuffle(['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8']); -// 1/20 chance to see the modal -const nat20 = Math.ceil(Math.random() * 20) === 20; +// 1/10 chance to see the modal +const nat20 = Math.ceil(Math.random() * 10) === 10; const recaptchaReady = () => { return new Promise((resolve, reject) => { try { @@ -148,38 +148,6 @@ const FeedbackModal = ({ onClose }) => { formVersion: FORM_VERSION, }); }); - advance(); - }; - - const submitFreetext = async (text) => { - addPageAction({ - eventName: 'freeTextSubmitted', - category: 'SurveyFeedback', - responseId: guid, - response: text, - formVersion: FORM_VERSION, - }); - const recaptchaToken = await generateRecaptchaToken(); - const freetextSubmission = { - responseId: guid, - response: text, - formVersion: FORM_VERSION, - pageUrl: location.href, - locale: locale.locale, - recaptchaToken, - type: 'freeText', - }; - fetch( - 'https://docs-user-feedback-service.newrelic-external.com/survey-feedback', - { - method: 'POST', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - body: JSON.stringify(freetextSubmission), - } - ); setShowThankYou(true); const timer = setTimeout(() => { setDismissedCookieAndClose(); @@ -201,10 +169,7 @@ const FeedbackModal = ({ onClose }) => { > {step === 0 && } - {step === 1 && } - {step === 2 && !showThankYou && ( - - )} + {step === 1 && !showThankYou && } {showThankYou && } { ); }; -const Freetext = ({ onSubmit }) => { - const [text, setText] = useState(''); - const { t } = useTranslation(); - - return ( - <> - {t('surveyModal.freeTextIntro')} -

- {t('surveyModal.freeTextQuestion')} -

-