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

FOUR-19715: Mustache Variables Not Rendered in Field Validation Messages #441

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

eiresendez
Copy link
Contributor

@eiresendez eiresendez commented Oct 29, 2024

Mustache variables are not properly rendered in field validation messages. When a mustache variable is used in a field label, it should be correctly rendered within the validation error messages. Currently, the mustache variable appears as plain text (e.g., {{name}}) instead of showing the expected dynamic value, leading to confusion in the form’s validation feedback.

Steps to Reproduce:

  1. Create a form with conversational input.
  2. Add a field label that includes a mustache variable, such as {{username}}.
  3. Set up validation rules for that field (e.g., required field).
  4. Submit the form without filling in the field to trigger the validation error message.
  5. The mustache variable in the validation message is not replaced by its corresponding value; it shows up as plain text.

Expected Behavior:

  • Mustache variables should be properly rendered in the validation error messages, reflecting the dynamic value that is used in the field label.

Solution Implemented

  • Used Mustache.render to dynamically parse and render the mustache variables in the field label.
  • This approach ensures that validation messages display correctly with the dynamically rendered label.

Before:
before

After:
after

Related ticket

Copy link
Contributor

@estebangallego estebangallego left a comment

Choose a reason for hiding this comment

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

Works as expected

@ryancooley ryancooley merged commit 0bcf336 into release-2024-fall Oct 30, 2024
8 of 12 checks passed
@ryancooley ryancooley deleted the observation/FOUR-19715 branch October 30, 2024 21:19
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.

4 participants