-
Notifications
You must be signed in to change notification settings - Fork 909
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
feat: change question type #2646
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandeymangg works great :-) I only have one concern regarding the survey constants:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have this file apps/web/app/lib/questions.ts
:
formbricks/apps/web/app/lib/questions.ts
Line 60 in 0d36e11
label: "Single-Select", |
Can we reuse this and/or combine this into one file to have a single source of truth for question types?
apps/web/app/lib/questions.tsx
Outdated
@@ -230,3 +231,35 @@ export const getTSurveyQuestionTypeName = (id: string) => { | |||
const questionType = questionTypes.find((questionType) => questionType.id === id); | |||
return questionType?.label; | |||
}; | |||
|
|||
export const QUESTIONS_ICON_MAP: Record<TSurveyQuestionType, JSX.Element> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow avoid to declare things twice? We already listed out all the question types toegther with their icons in the questionTypes
variable. could we reuse this instead of defining again what question types exists and what their icon and name is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pandeymangg thanks for making the changes, looks great! :-)
What does this PR do?
Implements the change question type feature
Fixes #2579
Screen.Recording.2024-05-17.at.6.42.32.PM.mov
How should this be tested?
Checklist
Required
pnpm build
console.logs
git pull origin main
Appreciated