Skip to content

Commit

Permalink
fix(survey): fix question type placement and add open feedback templa…
Browse files Browse the repository at this point in the history
…te (#18125)

* move survey question type back up

* add open feedback template

* fix description
  • Loading branch information
liyiy authored Oct 20, 2023
1 parent 1900db9 commit 4b00140
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 21 deletions.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--bullet-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--empty-notebook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--headings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--notebooks-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--numbered-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-notebooks--text-formats.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified frontend/__snapshots__/scenes-app-surveys--new-survey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 21 additions & 21 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,6 @@ export default function SurveyEdit(): JSX.Element {
content: (
<Group name={`questions.${index}`} key={index}>
<div className="flex flex-col gap-2">
<Field name="question" label="Label">
<LemonInput value={question.question} />
</Field>

<Field
name="description"
label="Description (optional)"
>
{({ value, onChange }) => (
<HTMLEditor
value={value}
onChange={onChange}
writingHTMLDescription={
writingHTMLDescription
}
setWritingHTMLDescription={
setWritingHTMLDescription
}
/>
)}
</Field>
<Field
name="type"
label="Question type"
Expand Down Expand Up @@ -335,6 +314,27 @@ export default function SurveyEdit(): JSX.Element {
]}
/>
</Field>
<Field name="question" label="Label">
<LemonInput value={question.question} />
</Field>

<Field
name="description"
label="Description (optional)"
>
{({ value, onChange }) => (
<HTMLEditor
value={value}
onChange={onChange}
writingHTMLDescription={
writingHTMLDescription
}
setWritingHTMLDescription={
setWritingHTMLDescription
}
/>
)}
</Field>
{survey.questions.length > 1 && (
<Field name="optional" className="my-2">
<LemonCheckbox
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/scenes/surveys/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const NEW_SURVEY: NewSurvey = {
}

export enum SurveyTemplateType {
OpenFeedback = 'Open feedback',
Interview = 'User interview',
NPS = 'Net promoter score (NPS)',
CSAT = 'Customer satisfaction score (CSAT)',
Expand Down Expand Up @@ -244,4 +245,14 @@ export const defaultSurveyTemplates = [
],
description: 'Find out if it was something you said.',
},
{
type: SurveyTemplateType.OpenFeedback,
questions: [
{
type: SurveyQuestionType.Open,
question: 'What can we do to improve our product?',
},
],
description: "Let your users share what's on their mind.",
},
]

0 comments on commit 4b00140

Please sign in to comment.