Skip to content

Commit 14fee79

Browse files
authored
Merge pull request #24 from anveshthakur/fix/email-response-tab
Bug fixes
2 parents d12499f + e5fefd9 commit 14fee79

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

ui/src/components/app/SurveyResponsesPage.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ export function SurveyResponsesPage({
238238
case SurveyQuestionType.ShortText:
239239
case SurveyQuestionType.LongText:
240240
case SurveyQuestionType.Date:
241+
case SurveyQuestionType.Email:
241242
response = answer.answer.value as string
242243
break
243244
case SurveyQuestionType.MultipleChoice:

ui/src/components/app/survey/SurveyQuestions.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ export default function SurveyQuestions({
185185
/>
186186
)
187187
break
188-
case SurveyQuestionType.EmailText:
188+
case SurveyQuestionType.Email:
189189
questionContent = (
190190
<TextInput
191191
defaultValue={selectedStringValue || ''}
192192
placeholder="Type your email here..."
193193
required
194-
type='email'
194+
type="email"
195195
onChange={(e) => {
196196
const newValue = e.target.value === '' ? undefined : e.target.value
197197
setSelectedStringValue(newValue)
@@ -327,7 +327,7 @@ export default function SurveyQuestions({
327327
case SurveyQuestionType.SingleChoice:
328328
case SurveyQuestionType.ShortText:
329329
case SurveyQuestionType.LongText:
330-
case SurveyQuestionType.EmailText:
330+
case SurveyQuestionType.Email:
331331
case SurveyQuestionType.Date:
332332
payload = {
333333
value: selectedStringValue,
@@ -437,7 +437,11 @@ export default function SurveyQuestions({
437437
{currentQuestion.description && (
438438
<p className="caption">{currentQuestion.description}</p>
439439
)}
440-
<form className="form">{questionContent}</form>
440+
<form className="form" onSubmit={async (e) => {
441+
e.preventDefault()
442+
await submitAnswer()
443+
}}>
444+
{questionContent}</form>
441445
<div className="w-full flex justify-center mt-8">
442446
<Button
443447
className="next-question"

ui/src/lib/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export enum SurveyQuestionType {
6868
Rating = 'rating',
6969
Ranking = 'ranking',
7070
YesNo = 'yes-no',
71-
EmailText = 'email'
71+
Email = 'email',
7272
}
7373

7474
export enum SurveySessionStatus {

0 commit comments

Comments
 (0)