-
Notifications
You must be signed in to change notification settings - Fork 1k
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
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.
@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?
@@ -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}`)) { |
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.
Why is this needed? Typescript isn't complaining without it and also there are other occurences of
if (question.headline[selectedLanguageCode]...
in the file
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.
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 😊
.../app/(app)/environments/[environmentId]/surveys/[surveyId]/edit/components/SurveyMenuBar.tsx
Outdated
Show resolved
Hide resolved
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.
@Dhruwang thanks for the fix :-) Looks good!
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
pnpm build
console.logs
git pull origin main
Appreciated