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: nps and rating validation issue with mls #2419

Merged
merged 7 commits into from
Apr 10, 2024
Merged

fix: nps and rating validation issue with mls #2419

merged 7 commits into from
Apr 10, 2024

Conversation

Dhruwang
Copy link
Contributor

@Dhruwang Dhruwang commented Apr 9, 2024

What does this PR do?

Fixes validation failing for nps and rating due to buttonLabel value
Also add functionality to make backButtonLabel undefined when it is the first question
Lavel validations for matrix question

How should this be tested?

Add NPS question
Enable translation (eng, german)
Make it optional, so you see an input field to configure next button value, write eng translation but leave german blank
Make it required (input field for next button disappears)
When trying to save it, we try to validate using default value, that if default value exist german translation should exist too
And hence throws validation error while saving (edited)

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 Apr 9, 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 Apr 10, 2024 1:17pm
formbricks-com ⬜️ Ignored (Inspect) Visit Preview Apr 10, 2024 1:17pm

Copy link
Contributor

github-actions bot commented Apr 9, 2024

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

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.

@Dhruwang thanks for the fix :-) I have a few change requests / questions.
Also is the Skip Button Label in CTA questions also affected of this?
image

@@ -132,7 +132,7 @@ export default function QuestionsView({

// check if we are recalling from this question
updatedSurvey.questions.forEach((question) => {
if (question.headline[selectedLanguageCode].includes(`recall:${questionId}`)) {
if (question.headline[selectedLanguageCode]?.includes(`recall:${questionId}`)) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed? Typescript isn't complaining without it and also there are other occurences of

if (question.headline[selectedLanguageCode]...

in the file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a case where question.headline[selectedLanguageCode] becomes undefined and deletion is blocked, hence fixed the issue where it becomes undefined and reverted this change 😊

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.

@Dhruwang thanks for the fix :-) Looks good!

@mattinannt mattinannt added this pull request to the merge queue Apr 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 10, 2024
@Dhruwang Dhruwang added this pull request to the merge queue Apr 10, 2024
Merged via the queue into main with commit 425d970 Apr 10, 2024
12 checks passed
@Dhruwang Dhruwang deleted the mls-bug branch April 10, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants