Loading frontend/src/actionlog/InjectMessage/Content/TraineeQuestionnaireContent.tsx +44 −38 Original line number Diff line number Diff line Loading @@ -94,23 +94,26 @@ const AnswerState = ( let result = true set(({ questions }) => ({ questions: questions.map(question => { let error = '' if (question.answer.length === 0) { const answerOptional = question.question.details.__typename === 'FreeFormQuestionDetailsType' && question.question.details.min === 0 if (!answerOptional && question.answer.length === 0) { result = false error = t('questionnaire.answerRequired') } else { return { ...question, error: t('questionnaire.answerRequired'), } } let error = '' if ( question.question.details.__typename === 'FreeFormQuestionDetailsType' || question.question.details.__typename === 'AutoFreeFormQuestionDetailsType' ) { const answer = question.answer.at(0) if (answer === undefined) { throw new Error( 'FreeFormQuestionDetailsType should have exactly one answer' ) } const answer = question.answer.at(0) || '' const { min, max } = question.question.details if (answer.length < min) { Loading @@ -136,7 +139,7 @@ const AnswerState = ( } } } } return { ...question, error: error || '', Loading Loading @@ -238,7 +241,10 @@ const TraineeQuestionnaireContent: FC<TraineeQuestionnaireContentProps> = ({ questInput: { answers: questionsAndAnswers.map(questionAndAnswer => ({ questionId: questionAndAnswer.question.id, value: questionAndAnswer.answer, value: questionAndAnswer.answer.length === 0 ? [''] : questionAndAnswer.answer, })), questionnaireId, teamId, Loading graphql/fragments.ts +1 −0 Original line number Diff line number Diff line Loading @@ -1072,6 +1072,7 @@ export const Question = graphql( } type details { __typename ... on RadioQuestionDetailsType { ...RadioQuestionDetails } Loading graphql/graphql-cache.d.ts +23 −23 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
frontend/src/actionlog/InjectMessage/Content/TraineeQuestionnaireContent.tsx +44 −38 Original line number Diff line number Diff line Loading @@ -94,23 +94,26 @@ const AnswerState = ( let result = true set(({ questions }) => ({ questions: questions.map(question => { let error = '' if (question.answer.length === 0) { const answerOptional = question.question.details.__typename === 'FreeFormQuestionDetailsType' && question.question.details.min === 0 if (!answerOptional && question.answer.length === 0) { result = false error = t('questionnaire.answerRequired') } else { return { ...question, error: t('questionnaire.answerRequired'), } } let error = '' if ( question.question.details.__typename === 'FreeFormQuestionDetailsType' || question.question.details.__typename === 'AutoFreeFormQuestionDetailsType' ) { const answer = question.answer.at(0) if (answer === undefined) { throw new Error( 'FreeFormQuestionDetailsType should have exactly one answer' ) } const answer = question.answer.at(0) || '' const { min, max } = question.question.details if (answer.length < min) { Loading @@ -136,7 +139,7 @@ const AnswerState = ( } } } } return { ...question, error: error || '', Loading Loading @@ -238,7 +241,10 @@ const TraineeQuestionnaireContent: FC<TraineeQuestionnaireContentProps> = ({ questInput: { answers: questionsAndAnswers.map(questionAndAnswer => ({ questionId: questionAndAnswer.question.id, value: questionAndAnswer.answer, value: questionAndAnswer.answer.length === 0 ? [''] : questionAndAnswer.answer, })), questionnaireId, teamId, Loading
graphql/fragments.ts +1 −0 Original line number Diff line number Diff line Loading @@ -1072,6 +1072,7 @@ export const Question = graphql( } type details { __typename ... on RadioQuestionDetailsType { ...RadioQuestionDetails } Loading
graphql/graphql-cache.d.ts +23 −23 File changed.Preview size limit exceeded, changes collapsed. Show changes