From d2f1c8cb6460b04197e7ed5bb61a83c628ecbf81 Mon Sep 17 00:00:00 2001 From: Max Chopart Date: Tue, 23 Apr 2024 18:37:50 +0200 Subject: [PATCH] [Fix #193] Passing intl prop to subquestion + changed wrong import --- src/components/Question.jsx | 1 + src/model/ValidationProcessor.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/Question.jsx b/src/components/Question.jsx index 64ed0a12..acfff3fe 100644 --- a/src/components/Question.jsx +++ b/src/components/Question.jsx @@ -501,6 +501,7 @@ export default class Question extends React.Component { question: question, onChange: this.handleSubQuestionChange, index: i, + intl: this.props.intl, }); } children.push(element); diff --git a/src/model/ValidationProcessor.js b/src/model/ValidationProcessor.js index 509d564d..afd83bed 100644 --- a/src/model/ValidationProcessor.js +++ b/src/model/ValidationProcessor.js @@ -1,5 +1,5 @@ import Constants from "../constants/Constants"; -import ValidatorFactory from "./ValidatorFactory.js"; +import { createValidator } from "./ValidatorFactory.js"; import Utils from "../util/Utils.js"; export default class ValidationProcessor { @@ -12,7 +12,7 @@ export default class ValidationProcessor { */ static updateQuestionValidation = (questions, question, index, intl) => { if (question[Constants.HAS_ANSWER]) { - const validator = ValidatorFactory.createValidator(question, intl); + const validator = createValidator(question, intl); const update = validator(); if (update) {