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

feat: change question type #2646

Merged
merged 12 commits into from
Jun 3, 2024
Merged

feat: change question type #2646

merged 12 commits into from
Jun 3, 2024

Conversation

pandeymangg
Copy link
Contributor

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?

  • Click the context menu icon on any question type, the change question type menu should appear
  • Change the question type

Checklist

Required

  • Filled out the "How to test" section in this PR
  • Read How we Code at Formbricks
  • Self-reviewed my own code
  • Commented on my code in hard-to-understand bits
  • Ran pnpm build
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues
  • First PR at Formbricks? Please sign the CLA! Without it we wont be able to merge it 🙏

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the Formbricks Docs if changes were necessary

Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 8:20am
formbricks-docs ⬜️ Ignored (Inspect) Visit Preview Jun 3, 2024 8:20am

Copy link
Contributor

github-actions bot commented May 17, 2024

Thank you for following the naming conventions for pull request titles! 🙏

@github-actions github-actions bot added the enhancement New feature or request label May 17, 2024
Copy link
Member

@mattinannt mattinannt left a 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:

Copy link
Member

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:

label: "Single-Select",

Can we reuse this and/or combine this into one file to have a single source of truth for question types?

@@ -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> = {
Copy link
Member

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?

Copy link
Member

@mattinannt mattinannt left a 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! :-)

@mattinannt mattinannt enabled auto-merge June 3, 2024 08:21
@mattinannt mattinannt added this pull request to the merge queue Jun 3, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 3, 2024
@pandeymangg pandeymangg added this pull request to the merge queue Jun 3, 2024
Merged via the queue into main with commit 2bf04e9 Jun 3, 2024
12 checks passed
@pandeymangg pandeymangg deleted the feat/change-question branch June 3, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Change question type
2 participants