Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Survey's placeholder customization not showing up #27089

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/src/scenes/surveys/SurveyCustomization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ export function Customization({
<>
<LemonField.Pure className="mt-2" label="Placeholder text">
<LemonInput
value={appearance?.placeholder || defaultSurveyAppearance.placeholder}
value={
appearance?.placeholder !== undefined
? appearance.placeholder
: defaultSurveyAppearance.placeholder
}
Comment on lines +140 to +144
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

onChange={(placeholder) => onAppearanceChange({ ...appearance, placeholder })}
disabled={!surveysStylingAvailable}
/>
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import './EditSurvey.scss'

import { DndContext } from '@dnd-kit/core'
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable'
import { IconInfo } from '@posthog/icons'
import { IconLock, IconPlus, IconTrash } from '@posthog/icons'
import { IconInfo, IconLock, IconPlus, IconTrash } from '@posthog/icons'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you intend to add IconInfo here? I think this might cause CI to yap because we're not using it afaict.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't intend to touch this! but I think what happened here is that my editor combined those two lines when formatting. if you see, ItemInfo was always there, and it's used in the file, but before we were importing it in a separate line

import {
LemonButton,
LemonCalendarSelect,
Expand Down Expand Up @@ -538,12 +537,12 @@ export default function SurveyEdit(): JSX.Element {
appearance={value || defaultSurveyAppearance}
hasBranchingLogic={hasBranchingLogic}
deleteBranchingLogic={deleteBranchingLogic}
customizeRatingButtons={
survey.questions[0].type === SurveyQuestionType.Rating
}
customizePlaceholderText={
survey.questions[0].type === SurveyQuestionType.Open
}
customizeRatingButtons={survey.questions.some(
(question) => question.type === SurveyQuestionType.Rating
)}
customizePlaceholderText={survey.questions.some(
(question) => question.type === SurveyQuestionType.Open
)}
onAppearanceChange={(appearance) => {
onChange(appearance)
}}
Expand Down
Loading